def test5(self): class A(object): def __init__(self, val): self.val = val def __eq__(self, other): return self.val == other.val a = A(1) b = A(2) self.assertIsInstance(find_changes(a, b), Diff)
def test6(self): class A(object): pass class B(object): pass a = A() b = B() diff = find_changes(a, b) self.assertIsInstance(diff, Diff) self.assertIsInstance(diff.changed, B)
def test4(self): a = [1] b = [2] self.assertIsInstance(find_changes(a, b), ListDiff)
def test3(self): a = {'a': 'a'} b = {'a': 'b'} self.assertIsInstance(find_changes(a, b), DictDiff)
def test2(self): a = 1 b = 2 self.assertIsInstance(find_changes(a, b), Diff)
def test1(self): a = b = 42 self.assertIs(find_changes(a, b), None)
def test2(self): changes = pythonify(jsonify(find_changes(self.a, self.b))) self.assertEqual(tups2lists(reconstitute(self.a, changes)), tups2lists(self.b))
def test1(self): changes = find_changes(self.a, self.b) self.assertEqual(tups2lists(reconstitute(self.a, changes)), tups2lists(self.b))