class TestTree: """Test the Tree class""" def setup_method(self, method): self.nbleaf = 20 self.tree = Tree(self.nbleaf) def teardown_method(self, method): self.tree = None def test_name(self): assert self.tree.get_name() == "Tree" def test_leaf(self): assert len(self.tree.leaf_list) == self.nbleaf
def setup_method(self, method): self.nbleaf = 20 self.tree = Tree(self.nbleaf)
def test_size(self): self.scene.add_object(Leaf()) self.scene.add_object(Trunk()) self.scene.add_object(Tree(2)) assert self.scene.get_size() == 3