def test_namedtuple(): Cat = namedtuple('Cat', 'name') cat = Cat(name='Mary') proxy = Proxy() proxy.name = 'Sam' new_cat = produce(proxy, cat) assert new_cat == Cat(name='Sam')
def test_dataclass(): @dataclass class Cat: name: str cat = Cat(name="Mary") proxy = Proxy() proxy.name = "Sam" new_cat = produce(proxy, cat) assert new_cat == Cat(name="Sam")