-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add DontWantOutput for TestSSO
- Loading branch information
1 parent
1dad712
commit 6822a03
Showing
2 changed files
with
16 additions
and
12 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 |
---|---|---|
|
@@ -163,14 +163,12 @@ func TestSSO(t *testing.T) { | |
// We set an SSO token that has expired. | ||
// This allows us to validate the output message about expiration. | ||
// We don't respond "Y" to prompt to reauthenticate. | ||
// But we've mocked the request to succeeds still so it doesn't matter. | ||
// But we've mocked the request to succeed still so it doesn't matter. | ||
{ | ||
TestScenario: testutil.TestScenario{ | ||
Args: args("whoami"), | ||
WantOutputs: []string{ | ||
"Your access token has expired and so has your refresh token.", | ||
"Alice Programmer <[email protected]>", | ||
}, | ||
Args: args("whoami"), | ||
WantOutput: "Your access token has expired and so has your refresh token.", | ||
DontWantOutput: "Alice Programmer <[email protected]>", | ||
}, | ||
ConfigFile: &config.File{ | ||
Profiles: config.Profiles{ | ||
|
@@ -326,6 +324,10 @@ func TestSSO(t *testing.T) { | |
} else { | ||
testutil.AssertStringContains(t, stdout.String(), testcase.WantOutput) | ||
} | ||
|
||
for _, s := range testcase.DontWantOutputs { | ||
testutil.AssertStringDoesntContain(t, stdout.String(), s) | ||
} | ||
}) | ||
} | ||
} |
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