summaryrefslogtreecommitdiff
path: root/scipy/weave/tests/test_standard_array_spec.py
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2005-09-26 20:20:16 +0000
committerTravis Oliphant <oliphant@enthought.com>2005-09-26 20:20:16 +0000
commit45d01a4be1c4221132ba46d687e6af3a8df3329b (patch)
treece3be5290e918def7c7187e747c5460193b0ca85 /scipy/weave/tests/test_standard_array_spec.py
parentccd1c3db37672627aa4fe0fdb5437f5dddc0fe86 (diff)
downloadnumpy-45d01a4be1c4221132ba46d687e6af3a8df3329b.tar.gz
Moved weave
Diffstat (limited to 'scipy/weave/tests/test_standard_array_spec.py')
-rw-r--r--scipy/weave/tests/test_standard_array_spec.py47
1 files changed, 47 insertions, 0 deletions
diff --git a/scipy/weave/tests/test_standard_array_spec.py b/scipy/weave/tests/test_standard_array_spec.py
new file mode 100644
index 000000000..5ce5667b2
--- /dev/null
+++ b/scipy/weave/tests/test_standard_array_spec.py
@@ -0,0 +1,47 @@
+import unittest
+from scipy_base.numerix import *
+from scipy_base.numerix import RandomArray
+import time
+
+from scipy_test.testing import *
+set_package_path()
+from weave import standard_array_spec
+restore_path()
+
+def remove_whitespace(in_str):
+ import string
+ out = string.replace(in_str," ","")
+ out = string.replace(out,"\t","")
+ out = string.replace(out,"\n","")
+ return out
+
+def print_assert_equal(test_string,actual,desired):
+ """this should probably be in scipy_test.testing
+ """
+ import pprint
+ try:
+ assert(actual == desired)
+ except AssertionError:
+ import cStringIO
+ msg = cStringIO.StringIO()
+ msg.write(test_string)
+ msg.write(' failed\nACTUAL: \n')
+ pprint.pprint(actual,msg)
+ msg.write('DESIRED: \n')
+ pprint.pprint(desired,msg)
+ raise AssertionError, msg.getvalue()
+
+class test_array_converter(unittest.TestCase):
+ def check_type_match_string(self):
+ s = standard_array_spec.array_converter()
+ assert( not s.type_match('string') )
+ def check_type_match_int(self):
+ s = standard_array_spec.array_converter()
+ assert(not s.type_match(5))
+ def check_type_match_array(self):
+ s = standard_array_spec.array_converter()
+ assert(s.type_match(arange(4)))
+
+if __name__ == "__main__":
+ ScipyTest('weave.standard_array_spec').run()
+