Example #1
0
def test_commit_command():
    commit = commands.commit(test_context, 
            ["-m", "my commit message", "bespin", "uvc"])
    assert not commit.reads_remote
    assert not commit.writes_remote
    message = commit.message
    assert message == "my commit message"
    assert commit.targets == ["bespin", "uvc"]
    assert str(commit) == "commit -m my commit message bespin uvc"
    
    try:
        commit = commands.commit(test_context, ["foo"])
        assert False, "Expected prompting for value"
    except commands.GetValueFromEditor,e :
        assert e.template_args == ["commit", '-m', commands.inserted_value, "foo"]
        assert e.prompt == "Please enter a commit message"
Example #2
0
def test_commit_is_secured():
    try:
        commit = commands.commit(secure_context, 
            ["-m", "commit message", topdir / ".." / "foo"])
        assert False, "Expected exception for going above topdir"
    except commands.SecurityError:
        pass
Example #3
0
def test_commit_command():
    test_context.user = "******"
    generic_commit = commands.commit(test_context, ["-m", "test message", "foo", "bar"])
    result = dialect.convert(generic_commit)
    assert not result.reads_remote
    assert not result.writes_remote
    command_parts = result.command_parts()
    assert command_parts == ["commit", "-u", "Zaphod Beeblebrox <*****@*****.**>",
                            "-m", "test message", "foo", "bar"]
Example #4
0
def test_push_after_commit():
    commit_file = path(test_context.working_dir) / ".svn_commit_messages"
    if commit_file.exists():
        commit_file.unlink()
    
    generic_commit = commands.commit(test_context, 
                ["-m", "test message1", "foo", "bar"])
    result = dialect.convert(generic_commit)
    result.get_output()
    
    generic_commit = commands.commit(test_context, 
                ["-m", "test message2", "foo", "bar"])
    result = dialect.convert(generic_commit)
    result.get_output()
    
    generic_push = commands.push(test_context, [])
    result = dialect.convert(generic_push)
    assert result.get_command_line() == ["svn", "commit", "-m", 
        "test message1\n\ntest message2\n\n"]
Example #5
0
def test_commit_command():
    commit_file = path(test_context.working_dir) / ".svn_commit_messages"
    if commit_file.exists():
        commit_file.unlink()
    
    generic_commit = commands.commit(test_context, 
                ["-m", "test message", "foo", "bar"])
    result = dialect.convert(generic_commit)
    assert result.get_command_line() == None
    assert str(result.get_output()) == "Commit message saved. Don't forget to push to save to the remote repository!"
    
    assert commit_file.exists(), "Expected commit file at " + commit_file
    assert commit_file.text() == "test message\n\n"