Permalink
Browse files

Added records unittest for fromfile method. Included file testdata.fi…

…ts file for use in test.
  • Loading branch information...
1 parent 3e11aea commit d54955f3f535bf65eba8b3b7e22ff3d9212b5a82 @chanley chanley committed Dec 29, 2005
Showing with 9 additions and 1 deletion.
  1. +1 −0 MANIFEST.in
  2. +8 −1 scipy/base/tests/test_records.py
  3. BIN scipy/base/tests/testdata.fits
View
@@ -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
@@ -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 @@ def check_recarray_fromarrays(self):
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()
Binary file not shown.

0 comments on commit d54955f

Please sign in to comment.