aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest/test_examples.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/test_examples.py b/test/test_examples.py
index d508d0f..9ba3ffe 100755
--- a/test/test_examples.py
+++ b/test/test_examples.py
@@ -86,6 +86,7 @@ def test_passthrough(tmpdir, name, debug, capfd):
tst_statvfs(work_dir)
tst_readdir(src_dir, work_dir)
+ tst_open_read(src_dir, work_dir)
if not is_ll:
tst_mkdir(work_dir)
tst_rmdir(src_dir, work_dir)
@@ -371,6 +372,14 @@ def tst_chown(mnt_dir):
assert fstat.st_uid == uid_new
assert fstat.st_gid == gid_new
+def tst_open_read(src_dir, mnt_dir):
+ name = name_generator()
+ with open(pjoin(src_dir, name), 'wb') as fh_out, \
+ open(TEST_FILE, 'rb') as fh_in:
+ shutil.copyfileobj(fh_in, fh_out)
+
+ assert filecmp.cmp(pjoin(mnt_dir, name), TEST_FILE, False)
+
def tst_open_write(src_dir, mnt_dir):
name = name_generator()
fd = os.open(pjoin(src_dir, name),