Ejemplo n.º 1
0
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))
Ejemplo n.º 2
0
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)
Ejemplo n.º 3
0
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)
Ejemplo n.º 4
0
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))
Ejemplo n.º 5
0
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))
Ejemplo n.º 6
0
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)
Ejemplo n.º 7
0
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)
Ejemplo n.º 8
0
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)
Ejemplo n.º 9
0
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))
Ejemplo n.º 10
0
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))
Ejemplo n.º 11
0
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)
Ejemplo n.º 12
0
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)