summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchanley <chanley@gmail.com>2005-12-29 16:00:17 +0000
committerchanley <chanley@gmail.com>2005-12-29 16:00:17 +0000
commitd54955f3f535bf65eba8b3b7e22ff3d9212b5a82 (patch)
tree1abc4dba94e6cc13f53d0271b6fbb5068edee4d5
parent3e11aea4a60519e882ba0c2cde93b49321d31933 (diff)
downloadpython-numpy-d54955f3f535bf65eba8b3b7e22ff3d9212b5a82.tar.gz
python-numpy-d54955f3f535bf65eba8b3b7e22ff3d9212b5a82.tar.bz2
python-numpy-d54955f3f535bf65eba8b3b7e22ff3d9212b5a82.zip
Added records unittest for fromfile method. Included file testdata.fits file for use in test.
-rw-r--r--MANIFEST.in1
-rw-r--r--scipy/base/tests/test_records.py9
-rw-r--r--scipy/base/tests/testdata.fitsbin0 -> 8640 bytes
3 files changed, 9 insertions, 1 deletions
diff --git a/MANIFEST.in b/MANIFEST.in
index 67d6fcbb8..2f50bcdd5 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -12,3 +12,4 @@ include MANIFEST.in
#recursive-include scipy/corelib/mtrand *.c *.h *.pyx *.pxi
#prune scipy/base/include/scipy
#recursive-include scipy/base/include/scipy *object.h
+#include scipy/base/tests/testdata.fits
diff --git a/scipy/base/tests/test_records.py b/scipy/base/tests/test_records.py
index bce842b08..8135a55a8 100644
--- a/scipy/base/tests/test_records.py
+++ b/scipy/base/tests/test_records.py
@@ -1,6 +1,7 @@
from scipy.testing import *
set_package_path()
+import os as _os
import scipy.base;reload(scipy.base)
from scipy.base import *
from scipy.base import records as rec
@@ -32,6 +33,12 @@ class test_fromrecords(ScipyTestCase):
x1[1] = 34
assert_equal(r.a,array([1,2,3,4]))
-
+ def check_recarray_fromfile(self):
+ __path__ = _os.path.split(__file__)
+ filename = _os.path.join(__path__[0], "testdata.fits")
+ fd = open(filename)
+ fd.seek(2880*2)
+ r = rec.fromfile(fd, formats='f8,i4,a5', shape=3, byteorder='big')
+
if __name__ == "__main__":
ScipyTest().run()
diff --git a/scipy/base/tests/testdata.fits b/scipy/base/tests/testdata.fits
new file mode 100644
index 000000000..ca48ee851
--- /dev/null
+++ b/scipy/base/tests/testdata.fits
Binary files differ