def test_stow_with_read_only_dest(source_a, dest): utils.remove_write_permission(dest) with pytest.raises(PermissionError) as e: dploy.stow([source_a], dest) assert (error.InsufficientPermissionsToSubcmdTo(subcmd=SUBCMD, file=dest).msg in str( e.value))
def test_unstow_with_read_only_dest(source_a, dest): dploy.stow([source_a], dest) utils.remove_write_permission(dest) with pytest.raises(PermissionError) as e: dploy.unstow([source_a], dest) assert error.InsufficientPermissionsToSubcmdTo( subcmd=SUBCMD, file=dest).msg in str(e.value)
def test_link_with_read_only_dest(file_a, dest): dest_file = os.path.join(dest, 'file_a_link') utils.remove_write_permission(dest) message = str( error.InsufficientPermissionsToSubcmdTo(subcmd=SUBCMD, file=dest_file)) with pytest.raises(error.InsufficientPermissionsToSubcmdTo, match=message): dploy.link(file_a, dest_file)
def test_unstow_with_read_only_dest(source_a, dest): dploy.stow([source_a], dest) utils.remove_write_permission(dest) message = str( error.InsufficientPermissionsToSubcmdTo(subcmd=SUBCMD, file=dest)) with pytest.raises(error.InsufficientPermissionsToSubcmdTo, match=message): dploy.unstow([source_a], dest)
def test_link_with_read_only_dest(file_a, dest): dest_file = os.path.join(dest, 'file_a_link') utils.remove_write_permission(dest) with pytest.raises(PermissionError) as e: dploy.link(file_a, dest_file) assert (error.InsufficientPermissionsToSubcmdTo( subcmd=SUBCMD, file=dest_file).msg in str(e.value))
def test_link_with_read_only_dest(file_a, dest): dest_file = os.path.join(dest, 'file_a_link') utils.remove_write_permission(dest) with pytest.raises(PermissionError) as e: dploy.link(file_a, dest_file) assert (error.InsufficientPermissionsToSubcmdTo(subcmd=SUBCMD, file=dest_file).msg in str(e.value))
def test_unstow_with_read_only_dest_file(source_a, dest): dploy.stow([source_a], dest) utils.remove_write_permission(os.path.join(dest, 'aaa')) dploy.unstow([source_a], dest)