def test_stow_with_source_with_no_executue_permissions(source_a, source_c, dest): utils.remove_execute_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_unstow_with_dest_with_no_executue_permissions(source_a, dest): dploy.stow([source_a], dest) utils.remove_execute_permission(dest) message = str( error.InsufficientPermissionsToSubcmdTo(subcmd=SUBCMD, file=dest)) with pytest.raises(error.InsufficientPermissionsToSubcmdTo, match=message): dploy.unstow([source_a], dest)
def test_stow_unfolding_with_first_sources_execute_permission_removed( source_a, source_b, dest): dploy.stow([source_a], dest) utils.remove_execute_permission(source_a) dest_dir = os.path.join(dest, 'aaa') message = str(error.PermissionDenied(subcmd=SUBCMD, file=dest_dir)) with pytest.raises(error.PermissionDenied, match=message): dploy.stow([source_b], dest)
def test_unstow_with_dest_with_no_executue_permissions(source_a, dest): dploy.stow([source_a], dest) utils.remove_execute_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_stow_with_source_with_no_executue_permissions(source_a, source_c, dest): utils.remove_execute_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_unstow_folding_with_multiple_sources_with_execute_permission_unset( source_a, source_b, dest): dploy.stow([source_a, source_b], dest) utils.remove_execute_permission(source_b) dest_dir = os.path.join(dest, 'aaa', 'ddd') message = str(error.PermissionDenied(subcmd=SUBCMD, file=dest_dir)) with pytest.raises(error.PermissionDenied, match=message): dploy.unstow([source_a], dest)
def test_stow_with_source_with_no_executue_permissions(source_a, source_c, dest): utils.remove_execute_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_unstow_folding_with_multiple_sources_with_execute_permission_unset( source_a, source_b, dest): dploy.stow([source_a, source_b], dest) utils.remove_execute_permission(source_b) with pytest.raises(PermissionError) as e: dploy.unstow([source_a], dest) dest_dir = os.path.join(dest, 'aaa', 'ddd') assert error.PermissionDenied(subcmd=SUBCMD, file=dest_dir).msg in str(e.value)
def test_stow_unfolding_with_first_sources_execute_permission_removed( source_a, source_b, dest): dploy.stow([source_a], dest) utils.remove_execute_permission(source_a) with pytest.raises(PermissionError) as e: dploy.stow([source_b], dest) dest_dir = os.path.join(dest, 'aaa') assert (error.PermissionDenied(subcmd=SUBCMD, file=dest_dir).msg in str( e.value))
def test_stow_unfolding_with_first_sources_execute_permission_removed( source_a, source_b, dest): dploy.stow([source_a], dest) utils.remove_execute_permission(source_a) with pytest.raises(PermissionError) as e: dploy.stow([source_b], dest) dest_dir = os.path.join(dest, 'aaa') assert (error.PermissionDenied(subcmd=SUBCMD, file=dest_dir).msg in str(e.value))
def test_unstow_with_dest_dir_with_no_executue_permissions( source_a, source_b, dest): dest_dir = os.path.join(dest, 'aaa') dploy.stow([source_a, source_b], dest) utils.remove_execute_permission(os.path.join(dest, 'aaa')) message = str( error.InsufficientPermissionsToSubcmdTo(subcmd=SUBCMD, file=dest_dir)) with pytest.raises(error.InsufficientPermissionsToSubcmdTo, match=message): dploy.unstow([source_a, source_b], dest)
def test_unstow_with_dest_dir_with_no_executue_permissions( source_a, source_b, dest): dest_dir = os.path.join(dest, 'aaa') dploy.stow([source_a, source_b], dest) utils.remove_execute_permission(os.path.join(dest, 'aaa')) with pytest.raises(PermissionError) as e: dploy.unstow([source_a, source_b], dest) assert error.InsufficientPermissionsToSubcmdTo(subcmd=SUBCMD, file=dest_dir).msg in str( e.value)