def test_stow_unfolding_with_write_only_source_file(source_a, source_b, dest): source_file = os.path.join(source_a, 'aaa') utils.remove_read_permission(source_file) with pytest.raises(PermissionError) as e: dploy.stow([source_a, source_b], dest) assert (error.InsufficientPermissionsToSubcmdFrom( subcmd=SUBCMD, file=source_file).msg in str(e.value))
def test_link_with_write_only_source(file_a, dest): dest_file = os.path.join(dest, 'file_a_link') utils.remove_read_permission(file_a) with pytest.raises(PermissionError) as e: dploy.link(file_a, dest_file) assert error.InsufficientPermissions(subcmd=SUBCMD, file=file_a).msg in str(e.value)
def test_stow_with_write_only_source(source_a, source_c, dest): utils.remove_read_permission(source_a) with pytest.raises(PermissionError) as e: dploy.stow([source_a, source_c], dest) assert (error.InsufficientPermissionsToSubcmdFrom(subcmd=SUBCMD, file=source_a).msg in str(e.value))
def test_link_with_write_only_source(file_a, dest): dest_file = os.path.join(dest, 'file_a_link') utils.remove_read_permission(file_a) with pytest.raises(PermissionError) as e: dploy.link(file_a, dest_file) assert error.InsufficientPermissions( subcmd=SUBCMD, file=file_a).msg in str(e.value)
def test_stow_with_write_only_source(source_a, source_c, dest): utils.remove_read_permission(source_a) message = str( error.InsufficientPermissionsToSubcmdFrom(subcmd=SUBCMD, file=source_a)) with pytest.raises(error.InsufficientPermissionsToSubcmdFrom, match=message): dploy.stow([source_a, source_c], dest)
def test_stow_unfolding_with_write_only_source_file(source_a, source_b, dest): source_file = os.path.join(source_a, 'aaa') utils.remove_read_permission(source_file) with pytest.raises(PermissionError) as e: dploy.stow([source_a, source_b], dest) assert (error.InsufficientPermissionsToSubcmdFrom(subcmd=SUBCMD, file=source_file).msg in str(e.value))
def test_stow_with_write_only_source_file(source_a, dest): source_file = os.path.join(source_a, 'aaa') utils.remove_read_permission(source_file) dploy.stow([source_a], dest)
def test_unstow_with_write_only_dest_file(source_a, dest): dploy.stow([source_a], dest) utils.remove_read_permission(os.path.join(dest, 'aaa')) dploy.unstow([source_a], dest)
def test_stow_with_write_only_source(source_a, source_c, dest): utils.remove_read_permission(source_a) with pytest.raises(PermissionError) as e: dploy.stow([source_a, source_c], dest) assert (error.InsufficientPermissionsToSubcmdFrom( subcmd=SUBCMD, file=source_a).msg in str(e.value))
def test_link_with_write_only_source(file_a, dest): dest_file = os.path.join(dest, 'file_a_link') utils.remove_read_permission(file_a) message = str(error.InsufficientPermissions(subcmd=SUBCMD, file=file_a)) with pytest.raises(error.InsufficientPermissions, match=message): dploy.link(file_a, dest_file)