Beispiel #1
0
 def test_object_ignore_equal(self):
     obj1 = MyObj(foo=1, bar='goodbye')
     obj1.obj_reset_changes()
     obj2 = MyObj(foo=1, bar='hello')
     obj2.obj_reset_changes()
     self.assertTrue(base.obj_equal_prims(obj1, obj2, ['bar']),
                     "Objects that only differ in an ignored field "
                     "should be equal")
Beispiel #2
0
 def test_object_not_equal(self):
     obj1 = MyObj(foo=1, bar='goodbye')
     obj1.obj_reset_changes()
     obj2 = MyObj(foo=1, bar='hello')
     obj2.obj_reset_changes()
     self.assertFalse(base.obj_equal_prims(obj1, obj2),
                      "Objects that differ in any field "
                      "should not be equal")
Beispiel #3
0
 def test_object_ignore_equal(self):
     obj1 = MyObj(foo=1, bar='goodbye')
     obj1.obj_reset_changes()
     obj2 = MyObj(foo=1, bar='hello')
     obj2.obj_reset_changes()
     self.assertTrue(
         base.obj_equal_prims(obj1, obj2, ['bar']),
         "Objects that only differ in an ignored field "
         "should be equal")
Beispiel #4
0
 def test_object_not_equal(self):
     obj1 = MyObj(foo=1, bar='goodbye')
     obj1.obj_reset_changes()
     obj2 = MyObj(foo=1, bar='hello')
     obj2.obj_reset_changes()
     self.assertFalse(
         base.obj_equal_prims(obj1, obj2),
         "Objects that differ in any field "
         "should not be equal")
Beispiel #5
0
 def test_object_equal(self):
     obj1 = MyObj(foo=1, bar='goodbye')
     obj1.obj_reset_changes()
     obj2 = MyObj(foo=1, bar='goodbye')
     obj2.obj_reset_changes()
     obj2.bar = 'goodbye'
     # obj2 will be marked with field 'three' updated
     self.assertTrue(base.obj_equal_prims(obj1, obj2),
                     "Objects that differ only because one a is marked "
                     "as updated should be equal")
Beispiel #6
0
 def test_object_equal(self):
     obj1 = MyObj(foo=1, bar='goodbye')
     obj1.obj_reset_changes()
     obj2 = MyObj(foo=1, bar='goodbye')
     obj2.obj_reset_changes()
     obj2.bar = 'goodbye'
     # obj2 will be marked with field 'three' updated
     self.assertTrue(
         base.obj_equal_prims(obj1, obj2),
         "Objects that differ only because one a is marked "
         "as updated should be equal")
Beispiel #7
0
 def _assert_notification_data(self, expected, actual):
     self.assertTrue(obj_base.obj_equal_prims(expected, actual),
                     "The notifications objects were not equal")
Beispiel #8
0
 def _assert_host_data(self, expected, actual):
     self.assertTrue(obj_base.obj_equal_prims(expected, actual),
                     "The host objects were not equal")
Beispiel #9
0
 def _assert_segment_data(self, expected, actual):
     self.assertTrue(obj_base.obj_equal_prims(expected, actual),
                     "The failover segment objects were not equal")
Beispiel #10
0
 def _assert_segment_data(self, expected, actual):
     self.assertTrue(obj_base.obj_equal_prims(expected, actual),
                     "The failover segment objects were not equal")
Beispiel #11
0
 def _assert_host_data(self, expected, actual):
     self.assertTrue(obj_base.obj_equal_prims(expected, actual),
                     "The host objects were not equal")
Beispiel #12
0
 def _assert_notification_data(self, expected, actual):
     self.assertTrue(obj_base.obj_equal_prims(expected, actual),
                     "The notification objects were not equal")