summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--numpy/core/tests/test_multiarray.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/numpy/core/tests/test_multiarray.py b/numpy/core/tests/test_multiarray.py
index 7bc9875ab..7022ef14d 100644
--- a/numpy/core/tests/test_multiarray.py
+++ b/numpy/core/tests/test_multiarray.py
@@ -782,7 +782,7 @@ class TestLexsort(TestCase):
class TestIO(object):
"""Test tofile, fromfile, tostring, and fromstring"""
-
+
def setUp(self):
shape = (2,4,3)
rand = np.random.random
@@ -796,6 +796,18 @@ class TestIO(object):
os.unlink(self.filename)
#tmp_file.close()
+ def test_empty_files_binary(self):
+ f = open(self.filename, 'w')
+ f.close()
+ y = fromfile(self.filename)
+ assert_(y.size == 0, "Array not empty")
+
+ def test_empty_files_text(self):
+ f = open(self.filename, 'w')
+ f.close()
+ y = fromfile(self.filename, sep=" ")
+ assert_(y.size == 0, "Array not empty")
+
def test_roundtrip_file(self):
f = open(self.filename, 'wb')
self.x.tofile(f)