def test__is_cow(self): """ Test if the subvolume is copy on write. """ salt_mock = { "file.lsattr": MagicMock(return_value={"/tmp/xxx/@/var": []}), } with patch.dict(btrfs.__salt__, salt_mock): assert btrfs._is_cow("/tmp/xxx/@/var") salt_mock["file.lsattr"].assert_called_with("/tmp/xxx/@")
def test__is_cow(self): ''' Test if the subvolume is copy on write. ''' salt_mock = { 'file.lsattr': MagicMock(return_value={ '/tmp/xxx/@/var': [], }), } with patch.dict(btrfs.__salt__, salt_mock): assert btrfs._is_cow('/tmp/xxx/@/var') salt_mock['file.lsattr'].assert_called_with('/tmp/xxx/@')