Last change
on this file since 44 was
29,
checked in by landauf, 17 years ago
|
updated boost from 1_33_1 to 1_34_1
|
File size:
1006 bytes
|
Line | |
---|
1 | # Copyright Ralf W. Grosse-Kunstleve 2006. Distributed under the Boost |
---|
2 | # Software License, Version 1.0. (See accompanying |
---|
3 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
---|
4 | r'''>>> from getting_started2 import * |
---|
5 | >>> hi = hello('California') |
---|
6 | >>> hi.greet() |
---|
7 | 'Hello from California' |
---|
8 | >>> invite(hi) |
---|
9 | 'Hello from California! Please come soon!' |
---|
10 | >>> hi.invite() |
---|
11 | 'Hello from California! Please come soon!' |
---|
12 | |
---|
13 | >>> class wordy(hello): |
---|
14 | ... def greet(self): |
---|
15 | ... return hello.greet(self) + ', where the weather is fine' |
---|
16 | ... |
---|
17 | >>> hi2 = wordy('Florida') |
---|
18 | >>> hi2.greet() |
---|
19 | 'Hello from Florida, where the weather is fine' |
---|
20 | >>> invite(hi2) |
---|
21 | 'Hello from Florida! Please come soon!' |
---|
22 | ''' |
---|
23 | |
---|
24 | def run(args = None): |
---|
25 | if args is not None: |
---|
26 | import sys |
---|
27 | sys.argv = args |
---|
28 | import doctest, test_getting_started2 |
---|
29 | return doctest.testmod(test_getting_started2) |
---|
30 | |
---|
31 | if __name__ == '__main__': |
---|
32 | import sys |
---|
33 | sys.exit(run()[0]) |
---|
34 | |
---|
Note: See
TracBrowser
for help on using the repository browser.