File tree Expand file tree Collapse file tree 1 file changed +20
-14
lines changed Expand file tree Collapse file tree 1 file changed +20
-14
lines changed Original file line number Diff line number Diff line change @@ -58,17 +58,23 @@ def __init__(self, request):
58
58
self .type = self .tablet_type
59
59
60
60
61
- if __name__ == '__main__' :
62
- front_controller = RequestController ()
63
- front_controller .dispatch_request (Request ('mobile' ))
64
- front_controller .dispatch_request (Request ('tablet' ))
65
-
66
- front_controller .dispatch_request (Request ('desktop' ))
67
- front_controller .dispatch_request ('mobile' )
68
-
69
-
70
- ### OUTPUT ###
71
- # Displaying mobile index page
72
- # Displaying tablet index page
73
- # cant dispatch the request
74
- # request must be a Request object
61
+ def main ():
62
+ """
63
+ >>> front_controller = RequestController()
64
+
65
+ >>> front_controller.dispatch_request(Request('mobile'))
66
+ Displaying mobile index page
67
+
68
+ >>> front_controller.dispatch_request(Request('tablet'))
69
+ Displaying tablet index page
70
+
71
+ >>> front_controller.dispatch_request(Request('desktop'))
72
+ cant dispatch the request
73
+
74
+ >>> front_controller.dispatch_request('mobile')
75
+ request must be a Request object
76
+ """
77
+
78
+ if __name__ == "__main__" :
79
+ import doctest
80
+ doctest .testmod ()
You can’t perform that action at this time.
0 commit comments