File tree Expand file tree Collapse file tree 1 file changed +25
-20
lines changed Expand file tree Collapse file tree 1 file changed +25
-20
lines changed Original file line number Diff line number Diff line change @@ -55,29 +55,34 @@ def render(self):
55
55
print ("Ellipse: {}" .format (self .name ))
56
56
57
57
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")
63
64
64
- graphic1 = CompositeGraphic ()
65
- graphic2 = CompositeGraphic ()
65
+ >>> graphic1 = CompositeGraphic()
66
+ >>> graphic2 = CompositeGraphic()
66
67
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)
71
72
72
- graphic = CompositeGraphic ()
73
+ >>> graphic = CompositeGraphic()
73
74
74
- graphic .add (graphic1 )
75
- graphic .add (graphic2 )
75
+ >>> graphic.add(graphic1)
76
+ >>> graphic.add(graphic2)
76
77
77
- graphic .render ()
78
+ >>> graphic.render()
79
+ Ellipse: 1
80
+ Ellipse: 2
81
+ Ellipse: 3
82
+ Ellipse: 4
83
+ """
78
84
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