def test_get_zfs_default(self, which): which.return_value = '/bin/true' zfs = get_zfs() assert type(zfs) == ZFSCli assert zfs.metadata_namespace is None assert zfs.executable == '/bin/true' which.assert_called_once_with('zfs')
def test_get_zfs_invalid(self): with pytest.raises(NotImplementedError): get_zfs('testing')
def test_get_zfs_native(self): zfs = get_zfs('native') assert type(zfs) == ZFSNative
def test_get_zfs_cli_args(self): zfs = get_zfs('cli', metadata_namespace='asdf', zfs_exe='/bin/true') assert type(zfs) == ZFSCli assert zfs.metadata_namespace == 'asdf' assert zfs.executable == '/bin/true'
def test_get_zfs_cli(self, which): which.return_value = '/bin/true' zfs = get_zfs('cli') assert type(zfs) == ZFSCli assert zfs.executable == '/bin/true' which.assert_called_once_with('zfs')