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