| 1151 | self.assertEqual(n - o, e) |
| 1152 | |
| 1153 | def testCopy(self): |
| 1154 | n1 = dns.name.from_text("foo.example.") |
| 1155 | n2 = copy.copy(n1) |
| 1156 | self.assertTrue(n1 is not n2) |
| 1157 | # the Name constructor always copies labels, so there is no |
| 1158 | # difference between copy and deepcopy |
| 1159 | self.assertTrue(n1.labels is not n2.labels) |
| 1160 | self.assertEqual(len(n1.labels), len(n2.labels)) |
| 1161 | for i, l in enumerate(n1.labels): |
| 1162 | self.assertTrue(l is n2[i]) |
| 1163 | |
| 1164 | def testDeepCopy(self): |
| 1165 | n1 = dns.name.from_text("foo.example.") |