diff options
| author | Dylan Baker <dylan@pnwbakers.com> | 2018-12-10 14:33:58 -0800 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2018-12-12 12:23:37 -0800 |
| commit | 978e6fb88f926da14314a3563de13197a092cc9f (patch) | |
| tree | 00d6d6d73d812561b4f778ccedfad109dc24a3ad /test cases/python/3 cython/cytest.py | |
| parent | f6405adc2de0c6cc494b4957df9d796b76195ec4 (diff) | |
| download | meson-978e6fb88f926da14314a3563de13197a092cc9f.tar.gz | |
tests: Add tests for the python module
This doesn't touch everything as it's just based on the python3 module
tests, ported to the python module. It's still better than the one very
basic test in the unit test module.
Diffstat (limited to 'test cases/python/3 cython/cytest.py')
| -rwxr-xr-x | test cases/python/3 cython/cytest.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test cases/python/3 cython/cytest.py b/test cases/python/3 cython/cytest.py new file mode 100755 index 000000000..43443dc66 --- /dev/null +++ b/test cases/python/3 cython/cytest.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python3 + +from storer import Storer +import sys + +s = Storer() + +if s.get_value() != 0: + print('Initial value incorrect.') + sys.exit(1) + +s.set_value(42) + +if s.get_value() != 42: + print('Setting value failed.') + sys.exit(1) + +try: + s.set_value('not a number') + print('Using wrong argument type did not fail.') + sys.exit(1) +except TypeError: + pass |
