Remove remaining t.Fatal from the codebase (#13876)
* Remove remaining t.Fatal from the codebase * Fix job_store test * Address review comments * Remove comments
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
17523fa5d9
Коммит
84f45634a8
@@ -317,13 +317,8 @@ func TestGetOldClientConfig(t *testing.T) {
|
||||
config, resp := Client.GetOldClientConfig("")
|
||||
CheckNoError(t, resp)
|
||||
|
||||
if len(config["Version"]) == 0 {
|
||||
t.Fatal("config not returned correctly")
|
||||
}
|
||||
|
||||
if config["GoogleDeveloperKey"] != testKey {
|
||||
t.Fatal("config missing developer key")
|
||||
}
|
||||
require.NotEmpty(t, config["Version"], "config not returned correctly")
|
||||
require.Equal(t, testKey, config["GoogleDeveloperKey"])
|
||||
})
|
||||
|
||||
t.Run("without session", func(t *testing.T) {
|
||||
@@ -336,29 +331,24 @@ func TestGetOldClientConfig(t *testing.T) {
|
||||
config, resp := Client.GetOldClientConfig("")
|
||||
CheckNoError(t, resp)
|
||||
|
||||
if len(config["Version"]) == 0 {
|
||||
t.Fatal("config not returned correctly")
|
||||
}
|
||||
|
||||
if _, ok := config["GoogleDeveloperKey"]; ok {
|
||||
t.Fatal("config should be missing developer key")
|
||||
}
|
||||
require.NotEmpty(t, config["Version"], "config not returned correctly")
|
||||
require.Empty(t, config["GoogleDeveloperKey"], "config should be missing developer key")
|
||||
})
|
||||
|
||||
t.Run("missing format", func(t *testing.T) {
|
||||
Client := th.Client
|
||||
|
||||
if _, err := Client.DoApiGet("/config/client", ""); err == nil || err.StatusCode != http.StatusNotImplemented {
|
||||
t.Fatal("should have errored with 501")
|
||||
}
|
||||
_, err := Client.DoApiGet("/config/client", "")
|
||||
require.NotNil(t, err)
|
||||
require.Equal(t, http.StatusNotImplemented, err.StatusCode)
|
||||
})
|
||||
|
||||
t.Run("invalid format", func(t *testing.T) {
|
||||
Client := th.Client
|
||||
|
||||
if _, err := Client.DoApiGet("/config/client?format=junk", ""); err == nil || err.StatusCode != http.StatusBadRequest {
|
||||
t.Fatal("should have errored with 400")
|
||||
}
|
||||
_, err := Client.DoApiGet("/config/client?format=junk", "")
|
||||
require.NotNil(t, err)
|
||||
require.Equal(t, http.StatusBadRequest, err.StatusCode)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user