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
Этот коммит содержится в:
коммит произвёл
Miguel de la Cruz
родитель
78c2780bc7
Коммит
cf6496bb8f
@@ -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)
|
||||
}
|
||||
})
|
||||
|
||||
Ссылка в новой задаче
Block a user