mirror of
https://github.com/paulirish/git-open.git
synced 2026-09-15 01:36:26 -04:00
Added test cases for AWS Code Commit.
This commit is contained in:
parent
c68b9c16e8
commit
2ef17f07d8
5
git-open
5
git-open
|
|
@ -198,6 +198,11 @@ elif [[ "${#pathargs[@]}" -ge '2' && ${pathargs[${#pathargs[@]} - 2]} == '_git'
|
|||
fi
|
||||
elif [[ "$domain" =~ amazonaws\.com$ ]]; then
|
||||
# AWS Code Commit
|
||||
if (( is_issue )); then
|
||||
echo "Issue feature does not supported on AWS Code Commit." 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Take region name from domain.
|
||||
region=${domain#*.}
|
||||
region=${region%%.*}
|
||||
|
|
|
|||
|
|
@ -503,6 +503,39 @@ setup() {
|
|||
assert_output "https://gitopen.visualstudio.com/Project/_workitems?id=36"
|
||||
}
|
||||
|
||||
##
|
||||
## AWS Code Commit
|
||||
##
|
||||
|
||||
@test "aws: https url" {
|
||||
git remote set-url origin "https://git-codecommit.us-east-1.amazonaws.com/v1/repos/repo"
|
||||
git checkout -B "master"
|
||||
run ../git-open
|
||||
assert_output "https://us-east-1.console.aws.amazon.com/codecommit/home?region=us-east-1#/repository/repo/browse/"
|
||||
}
|
||||
|
||||
@test "aws: ssh url" {
|
||||
git remote set-url origin "ssh://git-codecommit.us-east-1.amazonaws.com/v1/repos/repo"
|
||||
git checkout -B "master"
|
||||
run ../git-open
|
||||
assert_output "https://us-east-1.console.aws.amazon.com/codecommit/home?region=us-east-1#/repository/repo/browse/"
|
||||
}
|
||||
|
||||
@test "aws: branch " {
|
||||
git remote set-url origin "https://git-codecommit.us-east-1.amazonaws.com/v1/repos/repo"
|
||||
git checkout -B "mybranch"
|
||||
run ../git-open
|
||||
assert_output "https://us-east-1.console.aws.amazon.com/codecommit/home?region=us-east-1#/repository/repo/browse/mybranch/--/"
|
||||
}
|
||||
|
||||
@test "aws: issue" {
|
||||
git remote set-url origin "https://git-codecommit.us-east-1.amazonaws.com/v1/repos/repo"
|
||||
git checkout -B "issues/#12"
|
||||
run ../git-open "--issue"
|
||||
[ "$status" -eq 1 ]
|
||||
assert_output "Issue feature does not supported on AWS Code Commit."
|
||||
}
|
||||
|
||||
|
||||
teardown() {
|
||||
cd ..
|
||||
|
|
|
|||
Loading…
Reference in a new issue