-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: repo name remote contains profile (#13)
When the remote contains a profile it was appended to the repository name. This was caused by #11. Issue: #11
- Loading branch information
Joris Conijn
authored
Jan 27, 2022
1 parent
52389cc
commit 7443e7a
Showing
2 changed files
with
24 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import pytest | ||
from unittest.mock import patch, MagicMock | ||
from pull_request_codecommit.repository import Repository | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"region, profile, repository", | ||
[ | ||
("eu-west-1", "my-profile", "my-repository"), | ||
("eu-central-1", "my-other-profile", "my-other-repository"), | ||
], | ||
) | ||
@patch("pull_request_codecommit.repository.GitClient") | ||
def test_remote( | ||
mock_git_client: MagicMock, region: str, profile: str, repository: str | ||
) -> None: | ||
mock_git_client.return_value.remote.return_value = ( | ||
f"codecommit::{region}://{profile}@{repository}" | ||
) | ||
repo = Repository("/my/repository") | ||
assert repo.remote.region == region | ||
assert repo.remote.profile == profile | ||
assert repo.remote.name == repository |