def test_merge_many_rules_first_wins(self): tt0 = {"foo2": {3: 3}} tt1 = {"foo2": {3: 4}} res = merge_many_rules(self.base, [tt0, tt1]) self.assertEquals(3, res["foo2"][3])
def test_merge_many_rules(self): tt0 = {"foo1": "whee"} tt1 = {"foo2": {2: 3, 3: 4}} tt2 = {"foo3": [4, 5, 6]} res = merge_many_rules(self.base, [tt0, tt1, tt2]) self.assertNotEqual(res, self.base) self.assertEquals("bar", res["foo1"]) self.assertEquals(2, res["foo2"][2]) self.assertEquals(4, res["foo2"][3]) self.assertIn(6, res["foo3"]) self.assertEquals(4, len(res["foo3"]))