Skip to content

Commit

Permalink
fix: support schema notation without a region
Browse files Browse the repository at this point in the history
Support both `codecommit://` and `codecommit::://` notations.

Issue: #7
  • Loading branch information
Joris Conijn committed Jan 25, 2022
1 parent 13bb074 commit debceaf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pull_request_codecommit/git/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __regex(self, pattern: str, index: int = 1) -> Optional[str]:

@property
def supported(self) -> bool:
return self.__url.startswith("codecommit::") and self.name != ""
return self.__url.startswith("codecommit:") and self.name != ""

@property
def url(self) -> str:
Expand Down
14 changes: 14 additions & 0 deletions tests/test_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,20 @@ def edit_message(message: str) -> str:
b"[default]\nbranch: my-main\n[profile my-profile]\nbranch: my-master",
COMMITS,
),
(
"codecommit://my-profile@my-repository",
None,
"my-profile",
b"[default]\nbranch: my-main\n[profile my-profile]\nbranch: my-master",
COMMITS,
),
(
"codecommit://my-repository",
None,
None,
b"[default]\nbranch: my-main\n[profile my-profile]\nbranch: my-master",
COMMITS,
),
],
)
@patch("pull_request_codecommit.aws.client.subprocess.run")
Expand Down

0 comments on commit debceaf

Please sign in to comment.