Merge pull request #1713 from ThomasWaldmann/fuse_mount-flexibility

fuse_mount contextmanager: accept any options
This commit is contained in:
enkore 2016-10-13 10:47:13 +02:00 committed by GitHub
commit dda439be57
2 changed files with 3 additions and 5 deletions

View file

@ -94,11 +94,9 @@ class BaseTestCase(unittest.TestCase):
self._assert_dirs_equal_cmp(sub_diff)
@contextmanager
def fuse_mount(self, location, mountpoint, mount_options=None):
def fuse_mount(self, location, mountpoint, *options):
os.mkdir(mountpoint)
args = ['mount', location, mountpoint]
if mount_options:
args += '-o', mount_options
args = ['mount', location, mountpoint] + list(options)
self.cmd(*args, fork=True)
self.wait_for_mount(mountpoint)
yield

View file

@ -1119,7 +1119,7 @@ class ArchiverTestCase(ArchiverTestCaseBase):
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'):
with self.fuse_mount(self.repository_location + '::archive', mountpoint, '-o', 'allow_damaged_files'):
open(os.path.join(mountpoint, path)).close()
def verify_aes_counter_uniqueness(self, method):