-
Notifications
You must be signed in to change notification settings - Fork 0
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 #109 from singnet/pbc-das-remote-v2
[#112] Add --remote flag to all cli commands
- Loading branch information
Showing
4 changed files
with
141 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Click==7.0 | ||
Click==8.1.6 | ||
docker==7.1.0 | ||
distro==1.9.0 | ||
click-man==0.4.1 | ||
|
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,55 @@ | ||
#!/usr/local/bin/bats | ||
|
||
load 'libs/bats-support/load' | ||
load 'libs/bats-assert/load' | ||
load 'libs/utils' | ||
load 'libs/docker' | ||
|
||
setup() { | ||
if [ -z "${REMOTE_HOST+x}" ]; then | ||
skip "Environment variable REMOTE_HOST is not set. Skipping all tests in this file." | ||
fi | ||
|
||
libs=(hyperon-das hyperon-das-atomdb) | ||
|
||
pip3 install hyperon-das==0.7.13 | ||
} | ||
|
||
teardown() { | ||
pip3 uninstall -y hyperon-das | ||
pip3 uninstall -y hyperon-das-atomdb | ||
} | ||
|
||
@test "Listing all python library versions" { | ||
local available_versions_regex="^.*\savailable\sversions:" | ||
local available_versions_match_count | ||
|
||
run python3 src/das_cli.py python-library list --remote --host $REMOTE_HOST | ||
|
||
available_versions_match_count=$(echo "$output" | grep -cE "$available_versions_regex") | ||
|
||
assert_output --regexp "$available_versions_regex" | ||
assert [ "$available_versions_match_count" -eq "${#libs[@]}" ] | ||
} | ||
|
||
@test "Show available python library versions" { | ||
local available_versions_regex="^.*\savailable\sversions:" | ||
|
||
for lib in "${libs[@]}"; do | ||
local available_versions_match_count | ||
|
||
run python3 src/das_cli.py python-library list --library "$lib" --remote --host $REMOTE_HOST | ||
available_versions_match_count=$(echo "$output" | grep -cE "$available_versions_regex") | ||
|
||
assert_output --regexp "$available_versions_regex" | ||
assert [ "$available_versions_match_count" -eq 1 ] | ||
done | ||
} | ||
|
||
@test "Trying to show version to an invalid python library" { | ||
local invalid_lib="invalid-python-library" | ||
|
||
run python3 src/das_cli.py python-library list --library $invalid_lib --remote --host $REMOTE_HOST | ||
|
||
assert_failure | ||
} |