예제 #1
0
 def test_to_dictionary(self):
     """Test conversion to dictionary"""
     r = Rectangle(1, 1, 1, 1, 1)
     d = {'id': 1, 'width': 1, 'height': 1, 'x': 1, 'y': 1}
     self.assertEqual(r.to_dictionary(), d)
     r.my_fun_new_attr = 42
     self.assertEqual(r.to_dictionary(), d)