Esempio n. 1
0
def test_diff_command():
    diff = commands.diff(test_context, ["myfile"])
    assert not diff.reads_remote
    assert not diff.writes_remote
    assert diff.targets == ["myfile"]
    assert str(diff) == "diff myfile"
    
    diff = commands.diff(test_context, [])
    assert diff.targets == None
    assert str(diff) == "diff"
Esempio n. 2
0
def test_diff_command():
    generic_diff = commands.diff(context, [])
    result = dialect.convert(generic_diff)
    assert not result.reads_remote
    assert not result.writes_remote
    assert str(result) == "diff"
Esempio n. 3
0
def test_diff_is_secured():
    try:
        diff = commands.diff(secure_context, [topdir / ".." / "foo"])
        assert False, "Expected exception for going above topdir"
    except commands.SecurityError:
        pass
Esempio n. 4
0
def test_diff_command():
    generic_diff = commands.diff(context, [])
    result = dialect.convert(generic_diff)
    assert str(result) == "diff"