def test_get(self): table = Table([Person(1, "Name1"), Person(2, "Name2")]) p = table.get(2) assert p.id_ == 2 assert p.name == "Name2"
def test_get_key_error(self): table = Table([Person(1, "Name")]) with pytest.raises(KeyError): table.get(2)
def act(cls): cls.person = Person.from_dictionary(cls.dict_repr)