Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/python/example/test_getting_started2.py @ 20

Last change on this file since 20 was 12, checked in by landauf, 17 years ago

added boost

File size: 812 bytes
Line 
1r'''>>> 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
21def 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
28if __name__ == '__main__':
29    import sys
30    sys.exit(run()[0])
31
Note: See TracBrowser for help on using the repository browser.