Пример #1
0
 def nonNullaryConstructor(self):
     expected_owner = Person(None, None, Address())
     expected = expected_owner.address
     expected_id = None
     animal = Animal(expected_id, expected_owner)
     actual_owner = animal.owner
     actual = animal.owner.address
     actual_id = animal.id
     self.assertEqual(expected_id, actual_id)
     self.assertEqual(expected_owner, actual_owner)
     self.assertEqual(expected, actual)
Пример #2
0
 def NonearyConstructor(self):
     expected_owner = Person()
     expected = expected_owner.address
     expected_id = None
     animal = Animal()
     actual_owner = animal.owner
     actual = animal.owner.address
     actual_id = animal.id
     self.assertEqual(expected_id, actual_id)
     self.assertEqual(expected_owner, actual_owner)
     self.assertEqual(expected, actual)