Skip to content

Commit

Permalink
test(rust): update bats tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SanjoDeundiak committed Aug 22, 2023
1 parent c05d1b7 commit 704d533
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ teardown() {

echo "{\"id\": \"1\",
\"name\" : \"default\",
\"identity\" : \"P6c20e814b56579306f55c64e8747e6c1b4a53d9a3f4ca83c252cc2fbfc72fa94\",
\"identity\" : \"I6c20e814b56579306f55c64e8747e6c1b4a53d9a\",
\"access_route\" : \"/dnsaddr/127.0.0.1/tcp/4000/service/api\",
\"authority_access_route\" : \"/dnsaddr/127.0.0.1/tcp/$port/service/api\",
\"authority_identity\" : \"$authority_identity_full\"}" >"$PROJECT_JSON_PATH"
Expand Down Expand Up @@ -91,7 +91,7 @@ teardown() {

echo "{\"id\": \"1\",
\"name\" : \"default\",
\"identity\" : \"P6c20e814b56579306f55c64e8747e6c1b4a53d9a3f4ca83c252cc2fbfc72fa94\",
\"identity\" : \"I6c20e814b56579306f55c64e8747e6c1b4a53d9a\",
\"access_route\" : \"/dnsaddr/127.0.0.1/tcp/4000/service/api\",
\"authority_access_route\" : \"/dnsaddr/127.0.0.1/tcp/$port/service/api\",
\"authority_identity\" : \"$authority_identity_full\"}" >"$PROJECT_JSON_PATH"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ teardown() {
run "$OCKAM" credential show smart_nyc_cred
assert_success
assert_output --partial "Credential: smart_nyc_cred"
assert_output --partial "Attributes: {\"application\": \"Smart Factory\", \"city\": \"New York\""
assert_output --partial "{\"application\": \"Smart Factory\", \"city\": \"New York\""

run "$OCKAM" credential list
assert_success
assert_output --partial "Credential: smart_nyc_cred"
assert_output --partial "Attributes: {\"application\": \"Smart Factory\", \"city\": \"New York\""
assert_output --partial "{\"application\": \"Smart Factory\", \"city\": \"New York\""
}

@test "credential - verify and store reject invalid credentials" {
Expand All @@ -50,7 +50,7 @@ teardown() {
idt1=$($OCKAM identity show i1 --full --encoding hex)

# create an invalid credential
echo "FOOBAR" >"$OCKAM_HOME/bad_credential"
echo "aabbcc" >"$OCKAM_HOME/bad_credential"

run "$OCKAM" credential verify --issuer "$idt1" --credential-path "$OCKAM_HOME/bad_credential"
assert_success
Expand Down
6 changes: 3 additions & 3 deletions implementations/rust/ockam/ockam_command/tests/bats/unit.bats
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ teardown() {

run "$OCKAM" identity show "${i}" --full
assert_success
assert_output --partial "Change History"
assert_output --partial "identifier"
assert_output --partial "signatures"
assert_output --partial "Change[0]:"
assert_output --partial "Identifier: "
assert_output --partial "primary_public_key: "
}

@test "identity - CRUD" {
Expand Down

0 comments on commit 704d533

Please sign in to comment.