コード例 #1
0
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
コード例 #2
0
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
コード例 #3
0
 def setup_method(self, method):
     self.nbleaf = 20
     self.tree = Tree(self.nbleaf)
コード例 #4
0
 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
コード例 #5
0
 def setup_method(self, method):
     self.nbleaf = 20
     self.tree = Tree(self.nbleaf)