Przeglądaj źródła

test_fuse_allow_damaged_files: assert exact error code

Marian Beermann 9 lat temu
rodzic
commit
1c7bdcdf9c
1 zmienionych plików z 2 dodań i 1 usunięć
  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()