Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jbsv committed Nov 17, 2023
1 parent 3238ee3 commit 2bf92d9
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions server/blockchain/calypso/calypso_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,24 @@ func TestCommand_ListSecrets(t *testing.T) {
require.Equal(t, "name1=secret1,name2=secret2", buf.String())
}

func TestCommand_ListSecrets_EmptySmcKey(t *testing.T) {
// Arrange
contract := NewContract(fakeAccess{})

buf := &bytes.Buffer{}
contract.printer = buf

cmd := calypsoCommand{
Contract: &contract,
}

// Act
err := cmd.listSecrets(fake.NewSnapshot(), makeStep(t, SmcPublicKeyArg, ""))

// Assert
require.Error(t, err, "'calypso:smc_key' not found in tx arg")
}

func TestCommand_ListSecrets_NonexistentSmc(t *testing.T) {
// Arrange
contract := NewContract(fakeAccess{})
Expand Down

0 comments on commit 2bf92d9

Please sign in to comment.