소스 검색

test_fuse_allow_damaged_files: assert exact error code

Marian Beermann 9 년 전
부모
커밋
1c7bdcdf9c
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      borg/testsuite/archiver.py

+ 2 - 1
borg/testsuite/archiver.py

@@ -1063,8 +1063,9 @@ class ArchiverTestCase(ArchiverTestCaseBase):
 
         mountpoint = os.path.join(self.tmpdir, 'mountpoint')
         with self.fuse_mount(self.repository_location + '::archive', mountpoint):
-            with pytest.raises(OSError):
+            with pytest.raises(OSError) as excinfo:
                 open(os.path.join(mountpoint, path))
+            assert excinfo.value.errno == errno.EIO
         with self.fuse_mount(self.repository_location + '::archive', mountpoint, 'allow_damaged_files'):
             open(os.path.join(mountpoint, path)).close()