Esempio n. 1
0
    def testChildIsInChildren(self):
        tree, child = Tree(), Tree()
        tree.addChild(child)

        actual = (child in tree.children())

        self.assertTrue(actual)
Esempio n. 2
0
    def testDataIsStored(self):
        expected = 1
        tree = Tree(expected)
        
        actual = tree.data()

        self.assertEquals(expected,actual)
Esempio n. 3
0
 def __init__(self, data = None):
     Tree.__init__(self,data)
Esempio n. 4
0
    def testDefaultDataIsNone(self):
        tree = Tree()

        actual = tree.data()

        self.assertEquals(None, actual)
Esempio n. 5
0
    def testAddingAChildDoesMakeAChild(self):
        tree = Tree().addChild(Tree())

        actual = tree.hasChildren()

        self.assertTrue(actual)
Esempio n. 6
0
    def testDefaultNoChildren(self):
        tree = Tree()

        actual = tree.hasChildren()
        
        self.assertFalse(actual)