diff options
Diffstat (limited to 'tests/test_read.py')
-rw-r--r-- | tests/test_read.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/test_read.py b/tests/test_read.py new file mode 100644 index 0000000..1a9b991 --- /dev/null +++ b/tests/test_read.py @@ -0,0 +1,23 @@ +import unittest
+from sciscipy import read, eval
+import numpy
+
+try:
+ import numpy
+ numpy_is_avail = 1
+except ImportError:
+ numpy_is_avail = 0
+
+class test_read(unittest.TestCase):
+ def setUp(self):
+ pass
+
+ def test_read_tlist(self):
+ eval("x=tlist(['test','a','b'],12,'item')")
+ x=read('x')
+ if numpy_is_avail:
+ num = numpy.array(12)
+ else:
+ num = 12
+ py_x = {'__tlist_name': 'test', 'a': num, 'b': ['item']}
+ assert x == py_x, str(py_x) + " != tlist(['test','a','b'],12,'item')"
\ No newline at end of file |