Skip to content

Commit

Permalink
Added records unittest for fromfile method. Included file testdata.fi…
Browse files Browse the repository at this point in the history
…ts file for use in test.
  • Loading branch information
chanley committed Dec 29, 2005
1 parent 3e11aea commit d54955f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 8 additions & 1 deletion scipy/base/tests/test_records.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 added scipy/base/tests/testdata.fits
Binary file not shown.

0 comments on commit d54955f

Please sign in to comment.