Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/parameter/test/python_test.py @ 30

Last change on this file since 30 was 29, checked in by landauf, 17 years ago

updated boost from 1_33_1 to 1_34_1

File size: 780 bytes
Line 
1# Copyright Daniel Wallin 2006. Distributed under the
2# Boost Software License, Version 1.0. (See accompanying file
3# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
4
5'''
6>>> from python_test_ext import X
7>>> x = X(y = 'baz')
8>>> x.value
9'foobaz'
10>>> x.f(1,2)
113
12>>> x.f(1,2,3)
136
14>>> x.f(1,2, z = 3)
156
16>>> x.f(z = 3, y = 2, x = 1)
176
18>>> x.g()
19'foobar'
20>>> x.g(y = "baz")
21'foobaz'
22>>> x.g(x = "baz")
23'bazbar'
24>>> x.g(y = "foo", x = "bar")
25'barfoo'
26>>> y = x.h(x = "bar", y = "foo")
27>>> assert x == y
28>>> y = x(0)
29>>> assert x == y
30'''
31
32def run(args = None):
33    if args is not None:
34        import sys
35        sys.argv = args
36    import doctest, python_test 
37    return doctest.testmod(python_test)
38
39if __name__ == '__main__':
40    import sys
41    sys.exit(run()[0])
Note: See TracBrowser for help on using the repository browser.