Skip to content

Commit

Permalink
Fix integration tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
maraino committed Dec 1, 2018
1 parent 468334a commit 122b7a6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion integration/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func (c CLICommand) test(t *testing.T, name string, expected string, msg ...inte
t.Run(name, func(t *testing.T) {
out, err := c.run()
assert.FatalError(t, err, fmt.Sprintf("`%s`: returned error '%s'\n\nOutput:\n%s", c.cmd(), err, out.combined))
assert.Equals(t, out.combined, expected, msg)
assert.Equals(t, out.combined, expected, msg...)
})
}

Expand Down
2 changes: 1 addition & 1 deletion integration/jwt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ func inspectJWT(jwt string) (map[string]interface{}, error) {
}

func (j JWTSignTest) checkJwt(t *testing.T, jwt string) {
// dbg.Stack()
header, payload, signature, err := decodeJWT(jwt)
assert.FatalError(t, err, "Error:", err, "JWT:", jwt)

Expand Down Expand Up @@ -740,6 +739,7 @@ func TestCryptoJWT(t *testing.T) {
for i := 0; i < 3; i++ {
assert.FatalError(t, cmd.ExpectTimeout(prompt, DefaultTimeout))
assert.FatalError(t, cmd.SendLine("foo"))
time.Sleep(1 * time.Second)
}
assert.FatalError(t, cmd.ExpectTimeout("failed to decrypt JWK: invalid password", DefaultTimeout))
})
Expand Down
6 changes: 3 additions & 3 deletions integration/keypair_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@ func (k KeypairCmd) test(t *testing.T) {
}

func (k KeypairCmd) testNoPass(t *testing.T) {
k.command.test(t, k.name, "", "")
k.command.test(t, k.name, "Your public key has been saved in testdata-tmp/no-pass.pub.\nYour private key has been saved in testdata-tmp/no-pass.pem.\n")
k.testJwtSignVerify(t)
}

func (k KeypairCmd) fail(t *testing.T, expected string) {
k.command.fail(t, k.name, expected, "")
k.command.fail(t, k.name, expected)
}

func (k KeypairCmd) failNoPass(t *testing.T, expected string) {
k.command.fail(t, k.name, expected, "")
k.command.fail(t, k.name, expected)
}

func NewKeypairCmd(name string) KeypairCmd {
Expand Down

0 comments on commit 122b7a6

Please sign in to comment.