Exemplo n.º 1
0
    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])
Exemplo n.º 2
0
    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])
Exemplo n.º 3
0
    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"]))
Exemplo n.º 4
0
    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"]))