-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kevin Gartland
committed
Feb 5, 2024
1 parent
c196143
commit 0d05e93
Showing
1 changed file
with
35 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,16 +7,45 @@ load '../node_modules/bats-assert/load' | |
@test "list accounts" { | ||
run ${EXE} list-accounts | ||
assert_success | ||
assert_output --partial "Nickname: \"env\"" | ||
assert_output --partial "Configured via: CONNECT_SERVER environment variable" | ||
assert_output --partial "Authentication: Connect API key" | ||
assert_line -p "Nickname: \"env\"" | ||
assert_line -p "Configured via: CONNECT_SERVER environment variable" | ||
assert_line -p "Authentication: Connect API key" | ||
} | ||
|
||
# test-account should pass with env | ||
@test "test accounts" { | ||
run ${EXE} test-account env | ||
assert_success | ||
assert_output --partial "Name: Administrator Smith" | ||
assert_output --partial "Username: admin" | ||
assert_output --partial "Email: [email protected]" | ||
assert_line -p "Name: Administrator Smith" | ||
assert_line -p "Username: admin" | ||
assert_line -p "Email: [email protected]" | ||
} | ||
|
||
@test "list accounts with no account" { | ||
unset CONNECT_SERVER | ||
run ${EXE} list-accounts | ||
assert_success | ||
assert_line "No accounts found. Use rsconnect or rsconnect-python to register an account." | ||
} | ||
|
||
@test "list accounts no API KEY" { | ||
unset CONNECT_API_KEY | ||
run ${EXE} list-accounts | ||
assert_success | ||
assert_line -p "Authentication: No saved credentials" | ||
} | ||
|
||
# tempoarily add the server with rsconnect-python | ||
@test "add the server and use it" { | ||
run rsconnect add -n ci-test -s $CONNECT_SERVER -k $CONNECT_API_KEY | ||
unset CONNECT_SERVER | ||
unset CONNECT_API_KEY | ||
run ${EXE} list-accounts | ||
assert_line -p "Nickname: \"ci-test\"" | ||
assert_line -p "Configured via: rsconnect-python" | ||
assert_line -p "Authentication: Connect API key" | ||
} | ||
|
||
teardown() { | ||
run rsconnect remove -n ci-test | ||
} |