示例#1
0
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))
示例#2
0
文件: test_link.py 项目: sleach/dploy
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)
示例#3
0
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))
示例#4
0
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)
示例#5
0
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)
示例#6
0
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))
示例#7
0
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)
示例#8
0
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)
示例#9
0
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)
示例#10
0
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))
示例#11
0
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)