Пример #1
0
 def test_merge_recursive(self):
     a = SubRecord({"m": SubRecord({"a": String()})})
     b = SubRecord({"a": String(), "m": SubRecord({"b": String()})})
     c = SubRecord({
         "a": String(),
         "m": SubRecord({
             "a": String(),
             "b": String()
         })
     })
     self.assertEquals(a.merge(b).to_dict(), c.to_dict())
Пример #2
0
 def test_merge_no_conflict(self):
     a = SubRecord({"a": String(), "b": SubRecord({"c": String()})})
     b = SubRecord({
         "d": String(),
     })
     valid = SubRecord({
         "a": String(),
         "b": SubRecord({"c": String()}),
         "d": String(),
     })
     self.assertEqual(a.merge(b).to_dict(), valid.to_dict())