File tree Expand file tree Collapse file tree 1 file changed +17
-12
lines changed Expand file tree Collapse file tree 1 file changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -91,18 +91,23 @@ def construct_building(cls):
91
91
return building
92
92
93
93
94
- # Client
95
- if __name__ == "__main__" :
96
- house = House ()
97
- print (house )
98
- flat = Flat ()
99
- print (flat )
94
+ def main ():
95
+ """
96
+ >>> house = House()
97
+ >>> house
98
+ Floor: One | Size: Big
99
+
100
+ >>> flat = Flat()
101
+ >>> flat
102
+ Floor: More than One | Size: Small
100
103
101
104
# Using an external constructor function:
102
- complex_house = construct_building (ComplexHouse )
103
- print (complex_house )
105
+ >>> complex_house = construct_building(ComplexHouse)
106
+ >>> complex_house
107
+ Floor: One | Size: Big and fancy
108
+ """
104
109
105
- ### OUTPUT ###
106
- # Floor: One | Size: Big
107
- # Floor: More than One | Size: Small
108
- # Floor: One | Size: Big and fancy
110
+
111
+ if __name__ == "__main__" :
112
+ import doctest
113
+ doctest . testmod ()
You can’t perform that action at this time.
0 commit comments