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