-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #104 from projectsyn/feature/override-git-url
Allow overriding of component URL in inventory
- Loading branch information
Showing
6 changed files
with
75 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,19 +6,27 @@ | |
import pytest | ||
|
||
from commodore import git | ||
from git import Repo | ||
from pathlib import Path | ||
|
||
|
||
def test_create_repository(tmp_path: Path): | ||
repo_path = tmp_path / 'test-repo' | ||
repo_path.mkdir() | ||
repo = git.create_repository(repo_path) | ||
def test_create_repository(tmpdir: Path): | ||
repo = git.create_repository(tmpdir) | ||
output = git.stage_all(repo) | ||
assert output != "" | ||
|
||
|
||
def test_clone_error(tmp_path: Path): | ||
def test_clone_error(tmpdir: Path): | ||
inexistent_url = 'ssh://[email protected]/some/repo.git' | ||
with pytest.raises(click.ClickException) as excinfo: | ||
git.clone_repository(inexistent_url, tmp_path) | ||
git.clone_repository(inexistent_url, tmpdir) | ||
assert inexistent_url in str(excinfo.value) | ||
|
||
|
||
def test_update_remote(tmpdir: Path): | ||
new_url = 'ssh://[email protected]/some/repo.git' | ||
repo = Repo.init(tmpdir) | ||
repo.create_remote('origin', url='ssh://') | ||
with pytest.raises(click.ClickException): | ||
git.update_remote(repo, new_url) | ||
assert repo.remotes.origin.url == new_url |