File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -55,12 +55,18 @@ def render(self):
55
55
return "<i>{}</i>" .format (self ._wrapped .render ())
56
56
57
57
58
+ def main ():
59
+ """
60
+ >>> simple_hello = TextTag("hello, world!")
61
+ >>> special_hello = ItalicWrapper(BoldWrapper(simple_hello))
62
+
63
+ >>> print("before:", simple_hello.render())
64
+ before: hello, world!
65
+
66
+ >>> print("after:", special_hello.render())
67
+ after: <i><b>hello, world!</b></i>
68
+ """
69
+
58
70
if __name__ == '__main__' :
59
- simple_hello = TextTag ("hello, world!" )
60
- special_hello = ItalicWrapper (BoldWrapper (simple_hello ))
61
- print ("before:" , simple_hello .render ())
62
- print ("after:" , special_hello .render ())
63
-
64
- ### OUTPUT ###
65
- # before: hello, world!
66
- # after: <i><b>hello, world!</b></i>
71
+ import doctest
72
+ doctest .testmod ()
You can’t perform that action at this time.
0 commit comments