MCPcopy Create free account
hub / github.com/rthalley/dnspython / testCopy

Method testCopy

tests/test_name.py:1153–1162  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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.")

Callers

nothing calls this directly

Calls 2

from_textMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected