diff options
author | manojgudi | 2013-07-23 07:54:12 +0530 |
---|---|---|
committer | manojgudi | 2013-07-23 07:54:12 +0530 |
commit | 43114165fb5e59c4267991f4922970c897fe2d88 (patch) | |
tree | c4cd97ed682dd75c0efa8991243b04b13633e270 /tests/test_read.py | |
download | sciscipy-1.0.0-43114165fb5e59c4267991f4922970c897fe2d88.tar.gz sciscipy-1.0.0-43114165fb5e59c4267991f4922970c897fe2d88.tar.bz2 sciscipy-1.0.0-43114165fb5e59c4267991f4922970c897fe2d88.zip |
initial commit
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 |