class TestScene:
    """Test the Scene class"""
    def setup_method(self, method):
        self.scene = Scene()

    def teardown_method(self, method):
        self.scene = None

    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
class TestScene:
    """Test the Scene class"""

    def setup_method(self, method):
        self.scene = Scene()

    def teardown_method(self, method):
        self.scene = None

    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
 def setup_method(self, method):
     self.scene = Scene()
Exemplo n.º 4
0
# -*- coding: latin-1 -*-

__doc__=" Example to use starter package "

from openalea.starter.sceneobject import Trunk, Leaf
from openalea.starter.scenecontainer import Scene
from openalea.starter.tree import Tree

#create a scene object
s=Scene()

#create a� trunk object
t=Trunk()

#add trunk to scene
s.add_object(t)

#add 10 leafs to the scene
for i in range(2):

    l=Leaf()
    s.add_object(l)

#create a complete tree
tr=Tree(6)
#add tree to scene
s.add_object(tr)


#display scene
s.display_scene()
 def setup_method(self, method):
     self.scene = Scene()