Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

test_big_file

  • Loading branch information...
commit c047e2987a9d54721d0d2a3fdfdd40bd2912dd7b 1 parent 7570323
@mikejs authored
Showing with 16 additions and 2 deletions.
  1. +16 −2 tests/basic.py
View
18 tests/basic.py
@@ -5,6 +5,7 @@
import subprocess
import time
import glob
+import stat
class BasicGridfsFUSETestCase(unittest.TestCase):
@@ -33,8 +34,6 @@ def test_read_write(self):
r.read())
def test_stat(self):
- import stat
-
path = os.path.join(self.mount, 'testfile.txt')
with open(path, 'w') as w:
w.write('test')
@@ -89,6 +88,21 @@ def test_rename(self):
with open(path2, 'r') as r:
self.assertEquals('file1', r.read())
+ def test_big_file(self):
+ # Test creation/reading of a file that's bigger than
+ # the chunk size
+ path = os.path.join(self.mount, 'big')
+ size = 256 * 1024 * 3 + 100
+ data = 'A' * size
+
+ with open(path, 'w') as w:
+ w.write(data)
+
+ with open(path, 'r') as r:
+ self.assertEquals(data, r.read())
+
+ self.assertEquals(size, os.stat(path).st_size)
+
def suite():
suite = unittest.TestSuite()
suite.addTest(BasicGridfsFUSETestCase())
Please sign in to comment.
Something went wrong with that request. Please try again.