Exemplo n.º 1
0
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')
Exemplo n.º 2
0
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")