Line | |
---|
1 | r'''>>> from getting_started2 import * |
---|
2 | >>> hi = hello('California') |
---|
3 | >>> hi.greet() |
---|
4 | 'Hello from California' |
---|
5 | >>> invite(hi) |
---|
6 | 'Hello from California! Please come soon!' |
---|
7 | >>> hi.invite() |
---|
8 | 'Hello from California! Please come soon!' |
---|
9 | |
---|
10 | >>> class wordy(hello): |
---|
11 | ... def greet(self): |
---|
12 | ... return hello.greet(self) + ', where the weather is fine' |
---|
13 | ... |
---|
14 | >>> hi2 = wordy('Florida') |
---|
15 | >>> hi2.greet() |
---|
16 | 'Hello from Florida, where the weather is fine' |
---|
17 | >>> invite(hi2) |
---|
18 | 'Hello from Florida! Please come soon!' |
---|
19 | ''' |
---|
20 | |
---|
21 | def run(args = None): |
---|
22 | if args is not None: |
---|
23 | import sys |
---|
24 | sys.argv = args |
---|
25 | import doctest, test_getting_started2 |
---|
26 | return doctest.testmod(test_getting_started2) |
---|
27 | |
---|
28 | if __name__ == '__main__': |
---|
29 | import sys |
---|
30 | sys.exit(run()[0]) |
---|
31 | |
---|
Note: See
TracBrowser
for help on using the repository browser.