Migrate tests from app/command_test.go to use testify (#12659)

* Migrate tests from app/command_test.go to use testify

* minor fix

* minor fix

* minor fix
This commit is contained in:
chahat arora
2019-10-27 16:12:21 +05:30
committed by Miguel de la Cruz
parent 78c2780bc7
commit cf6496bb8f

View File

@@ -119,13 +119,11 @@ func TestCreateCommand(t *testing.T) {
require.Nil(t, response.Error, "Failed to list commands")
if testCase.ExpectedErr == "" {
require.NotEmpty(t, cmds, "Failed to create command")
require.Equal(t, "testcmd", cmds[0].Trigger)
assert.NotZero(t, len(cmds), "Failed to create command")
assert.Equal(t, cmds[0].Trigger, "testcmd", "Failed to create command")
assert.Contains(t, string(actual), "PASS")
} else {
if len(cmds) > 1 {
require.Fail(t, "Created command that shouldn't have been created")
}
assert.LessOrEqual(t, len(cmds), 1, "Created command that shouldn't have been created")
assert.Contains(t, string(actual), testCase.ExpectedErr)
}
})