(self)
| 1660 | self.assertEqual(c.y, []) |
| 1661 | |
| 1662 | def test_helper_asdict_nested(self): |
| 1663 | @dataclass |
| 1664 | class UserId: |
| 1665 | token: int |
| 1666 | group: int |
| 1667 | @dataclass |
| 1668 | class User: |
| 1669 | name: str |
| 1670 | id: UserId |
| 1671 | u = User('Joe', UserId(123, 1)) |
| 1672 | d = asdict(u) |
| 1673 | self.assertEqual(d, {'name': 'Joe', 'id': {'token': 123, 'group': 1}}) |
| 1674 | self.assertIsNot(asdict(u), asdict(u)) |
| 1675 | u.id.group = 2 |
| 1676 | self.assertEqual(asdict(u), {'name': 'Joe', |
| 1677 | 'id': {'token': 123, 'group': 2}}) |
| 1678 | |
| 1679 | def test_helper_asdict_builtin_containers(self): |
| 1680 | @dataclass |
nothing calls this directly
no test coverage detected