예제 #1
0
 def testDangling_09_Count_03b_Deletion(self):
     p = TreeDict()
     self.assert_(p._numDangling() == 0)
     p.a
     self.assert_(p._numDangling() == 1)
     del p["a"]
     self.assert_(p._numDangling() == 0)
예제 #2
0
 def testDangling_09_Count_04_Branching(self):
     p = TreeDict()
     self.assert_(p._numDangling() == 0)
     p.a
     self.assert_(p._numDangling() == 1)
     p.makeBranch("a")
     self.assert_(p._numDangling() == 0)
예제 #3
0
    def testDangling_13_CorrectCountsThroughSiblingReferences(self):

        p = TreeDict()

        p.a = p.d
        self.assert_(p._numDangling() == 2)

        # Overwrite p.d; p.a still points to the dangling node, so the
        # count should not go down.

        p.d = 1
        self.assert_(p._numDangling() == 1)
예제 #4
0
 def testDangling_09_Count_02(self):
     p = TreeDict()
     self.assert_(p._numDangling() == 0)
     p.a.b
     self.assert_(p._numDangling() == 1)