Ejemplo n.º 1
0
 def test_copy(self):
     a = TuplePath(("k1", "k2", "k3"))
     b = a.copy()
     self.assertIsNot(a, b)
     self.assertEqual(a, b)
     a[1] = "foo"
     self.assertEqual(a, ("k1", "foo", "k3"))
     self.assertNotEqual(a, b)
Ejemplo n.º 2
0
 def test_copy__index_set(self):
     a = TuplePath(("k1", "k2", "k3"))
     b = a.copy(slice(1, len(a)))
     self.assertEqual(b, ("k2", "k3"))