File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,29 +55,34 @@ def render(self):
5555 print ("Ellipse: {}" .format (self .name ))
5656
5757
58- if __name__ == '__main__' :
59- ellipse1 = Ellipse ("1" )
60- ellipse2 = Ellipse ("2" )
61- ellipse3 = Ellipse ("3" )
62- ellipse4 = Ellipse ("4" )
58+ def main ():
59+ """
60+ >>> ellipse1 = Ellipse("1")
61+ >>> ellipse2 = Ellipse("2")
62+ >>> ellipse3 = Ellipse("3")
63+ >>> ellipse4 = Ellipse("4")
6364
64- graphic1 = CompositeGraphic ()
65- graphic2 = CompositeGraphic ()
65+ >>> graphic1 = CompositeGraphic()
66+ >>> graphic2 = CompositeGraphic()
6667
67- graphic1 .add (ellipse1 )
68- graphic1 .add (ellipse2 )
69- graphic1 .add (ellipse3 )
70- graphic2 .add (ellipse4 )
68+ >>> graphic1.add(ellipse1)
69+ >>> graphic1.add(ellipse2)
70+ >>> graphic1.add(ellipse3)
71+ >>> graphic2.add(ellipse4)
7172
72- graphic = CompositeGraphic ()
73+ >>> graphic = CompositeGraphic()
7374
74- graphic .add (graphic1 )
75- graphic .add (graphic2 )
75+ >>> graphic.add(graphic1)
76+ >>> graphic.add(graphic2)
7677
77- graphic .render ()
78+ >>> graphic.render()
79+ Ellipse: 1
80+ Ellipse: 2
81+ Ellipse: 3
82+ Ellipse: 4
83+ """
7884
79- ### OUTPUT ###
80- # Ellipse: 1
81- # Ellipse: 2
82- # Ellipse: 3
83- # Ellipse: 4
85+
86+ if __name__ == "__main__" :
87+ import doctest
88+ doctest .testmod ()
You can’t perform that action at this time.
0 commit comments