blob: 2782da549873bcd70c41ba56e4a4cfe6b0130493 [file] [log] [blame]
Wenzel Jakob57082212015-09-04 23:42:12 +02001#!/usr/bin/env python
2from __future__ import print_function
Wenzel Jakob38bd7112015-07-05 20:05:44 +02003import sys, pydoc
4sys.path.append('.')
5
6from example import Example2
7
8Example2.value = 15
9print(Example2.value)
10print(Example2.value2)
11
12try:
13 Example2()
14except Exception as e:
15 print(e)
16
17try:
18 Example2.value2 = 15
19except Exception as e:
20 print(e)
21
22instance = Example2.new_instance()
23
24dict_result = instance.get_dict()
25dict_result['key2'] = 'value2'
26instance.print_dict(dict_result)
27
28dict_result = instance.get_dict_2()
29dict_result['key2'] = 'value2'
30instance.print_dict_2(dict_result)
31
32list_result = instance.get_list()
33list_result.append('value2')
34instance.print_list(list_result)
35
36list_result = instance.get_list_2()
37list_result.append('value2')
38instance.print_list_2(list_result)
39
40try:
41 instance.throw_exception()
42except Exception as e:
43 print(e)
44
45print(instance.pair_passthrough((True, "test")))
46print(instance.tuple_passthrough((True, "test", 5)))
47
48print(pydoc.render_doc(Example2, "Help on %s"))