@@ 118-127 (lines=10) @@ | ||
115 | raised = True |
|
116 | self.assertTrue(raised, "md4 = %r" % type(md4)) |
|
117 | ||
118 | def test_30_ordered(self): |
|
119 | md0 = TT.make(_CNF_0, ordered=True) |
|
120 | ||
121 | self.assertTrue(isinstance(md0, MD.UpdateWithReplaceDict)) |
|
122 | self.assertTrue(isinstance(md0, MD.UpdateWithMergeOrderedDict)) |
|
123 | self.assertTrue(isinstance(md0["b"], MD.UpdateWithReplaceDict)) |
|
124 | self.assertTrue(isinstance(md0["b"], MD.UpdateWithMergeOrderedDict)) |
|
125 | for k in "name a c e f".split(): |
|
126 | self.assertTrue(md0[k] == _CNF_0[k], |
|
127 | "%r vs. %r" % (md0[k], _CNF_0[k])) |
|
128 | ||
129 | def test_40_namedtuple(self): |
|
130 | _point = collections.namedtuple("Point", "x y") |
|
@@ 83-92 (lines=10) @@ | ||
80 | self.assertTrue(isinstance(md0, MD.UpdateWithMergeDict)) |
|
81 | self.assertTrue(not md0) |
|
82 | ||
83 | def test_10_default(self): |
|
84 | md0 = TT.make(_CNF_0) |
|
85 | ||
86 | self.assertTrue(isinstance(md0, MD.UpdateWithReplaceDict)) |
|
87 | self.assertTrue(isinstance(md0, MD.UpdateWithMergeDict)) |
|
88 | self.assertTrue(isinstance(md0["b"], MD.UpdateWithReplaceDict)) |
|
89 | self.assertTrue(isinstance(md0["b"], MD.UpdateWithMergeDict)) |
|
90 | for k in "name a c e f".split(): |
|
91 | self.assertTrue(md0[k] == _CNF_0[k], |
|
92 | "%r vs. %r" % (md0[k], _CNF_0[k])) |
|
93 | ||
94 | def test_20_merge(self): |
|
95 | md1 = TT.make(_CNF_0, merge=MG.MS_REPLACE) |