Exemple #1
0
    def testCopyTree2(self):
        x = Link("@root.a.i", self.a, "x")
        self.assertEquals(x.node_path, "@root.a.x")
        self.assertEquals(x.link_path, "@root.a.i")
        self.assertRelative(x, "i")
        self.assertAbsolute(x, "@root.a.i")
        y = x.copy(self.b, "y")
        self.assertEquals(y.node_path, "@root.a.b.y")
        self.assertEquals(y.link_path, "@root.a.i")
        self.assertRelative(y, "..i")
        self.assertAbsolute(y, "@root.a.i")

        r2 = self.r.copy()
        a2 = self.a.copy(r2, "a")
        b2 = self.b.copy(a2, "b")
        x2 = x.copy(a2, "x")
        y2 = y.copy(b2, "y")

        self.assertEquals(x2.node_path, "@root.a.x")
        self.assertEquals(x2.link_path, "@root.a.i")
        self.assertRelative(x2, "i")
        self.assertAbsolute(x2, "@root.a.i")
        self.assertEquals(y2.node_path, "@root.a.b.y")
        self.assertEquals(y2.link_path, "@root.a.i")
        self.assertRelative(y2, "..i")
        self.assertAbsolute(y2, "@root.a.i")
Exemple #2
0
 def testCopy2(self):
     x = Link("..i", self.a, "x")
     y = x.copy(self.b, "y")
     self.assertEquals(x.node_path, "@root.a.x")
     self.assertRelative(x, "..i")
     self.assertAbsolute(x, "@root.i")
     self.assertEquals(y.node_path, "@root.a.b.y")
     self.assertRelative(y, "..i")
     self.assertAbsolute(y, "@root.a.i")
Exemple #3
0
 def testCopy1(self):
     x = Link("b", self.a, "x")
     self.assertEquals(x.node_path, "@root.a.x")
     self.assertRelative(x, "b")
     self.assertAbsolute(x, "@root.a.b")
     a2 = self.a.copy()
     x2 = x.copy(a2, "x")
     self.assertEquals(x2.node_path, "@root.x")
     self.assertRelative(x2, "b")
     self.assertAbsolute(x2, "@root.b")