Skip to content

Commit b62a0a8

Browse files
committed
Add doctest for bridge
1 parent 2d4a555 commit b62a0a8

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

patterns/structural/bridge.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,17 @@ def scale(self, pct):
3737

3838

3939
def main():
40-
shapes = (CircleShape(1, 2, 3, DrawingAPI1()), CircleShape(5, 7, 11, DrawingAPI2()))
40+
"""
41+
>>> shapes = (CircleShape(1, 2, 3, DrawingAPI1()), CircleShape(5, 7, 11, DrawingAPI2()))
4142
42-
for shape in shapes:
43-
shape.scale(2.5)
44-
shape.draw()
43+
>>> for shape in shapes:
44+
... shape.scale(2.5)
45+
... shape.draw()
46+
API1.circle at 1:2 radius 7.5
47+
API2.circle at 5:7 radius 27.5
48+
"""
4549

4650

4751
if __name__ == '__main__':
48-
main()
49-
50-
### OUTPUT ###
51-
# API1.circle at 1:2 radius 7.5
52-
# API2.circle at 5:7 radius 27.5
52+
import doctest
53+
doctest.testmod()

0 commit comments

Comments
 (0)