Beispiel #1
0
def test_commit_setter_wrong_type(mock_repo):
    """
    GIVEN GitRepo is initialized with a path and repo
    WHEN the commit setter is called with the wrong type
    THEN a TypeError is raised
    """
    repo = GitRepo('./', mock_repo)
    with pytest.raises(TypeError):
        repo.commit = repo
Beispiel #2
0
def test_commit_setter(mock_repo):
    """
    GIVEN GitRepo is initialized with a path and repo
    WHEN the commit setter is called
    THEN the commit is set as expected
    """
    repo = GitRepo('./', mock_repo)
    new_commit = GitCommit(git_repo=repo, logger=None)
    repo.commit = new_commit
    assert repo.commit == new_commit