Example #1
0
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))
Example #2
0
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)
Example #3
0
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)
Example #4
0
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)
Example #5
0
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))
Example #6
0
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))
Example #7
0
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)