Fixing api test cases. (#201)

This commit is contained in:
Todd Knight authored and GitHub committed 2020-07-16 10:54:24 -07:00
1 parent 4dfc41514b
commit 5826bf42fd
5 files changed
+13 -13

No files matched your search

+3 -3
View File
@@ -25,7 +25,7 @@ type groupCrud interface {
func TestGroup_List(t *testing.T) {
assert := assert.New(t)
tc := controller.NewTestController(t, nil)
tc := controller.NewTestController(t, &controller.TestControllerOpts{DisableAuthorizationFailures: true})
defer tc.Shutdown()
client := tc.Client()
@@ -101,7 +101,7 @@ func comparableSlice(in []*groups.Group) []groups.Group {
}
func TestGroup_Crud(t *testing.T) {
tc := controller.NewTestController(t, nil)
tc := controller.NewTestController(t, &controller.TestControllerOpts{DisableAuthorizationFailures: true})
defer tc.Shutdown()
client := tc.Client()
@@ -174,7 +174,7 @@ func TestGroup_Crud(t *testing.T) {
func TestGroup_Errors(t *testing.T) {
assert := assert.New(t)
tc := controller.NewTestController(t, nil)
tc := controller.NewTestController(t, &controller.TestControllerOpts{DisableAuthorizationFailures: true})
defer tc.Shutdown()
ctx := tc.Context()
+2 -2
View File
@@ -14,7 +14,7 @@ import (
)
func TestCatalogs_Crud(t *testing.T) {
tc := controller.NewTestController(t, nil)
tc := controller.NewTestController(t, &controller.TestControllerOpts{DisableAuthorizationFailures: true})
defer tc.Shutdown()
client := tc.Client()
@@ -68,7 +68,7 @@ func TestCatalogs_Crud(t *testing.T) {
// TODO: Get better coverage for expected errors and error formats.
func TestCatalogs_Errors(t *testing.T) {
assert := assert.New(t)
tc := controller.NewTestController(t, nil)
tc := controller.NewTestController(t, &controller.TestControllerOpts{DisableAuthorizationFailures: true})
defer tc.Shutdown()
ctx := tc.Context()
+2 -2
View File
@@ -22,12 +22,12 @@ func TestAuthenticate(t *testing.T) {
}
ctx := context.Background()
tok, apiErr, err := org.Authenticate(ctx, "am_anything", "admin", "hunter2")
tok, apiErr, err := org.Authenticate(ctx, "am_1234567890", "admin", "hunter2")
assert.NoError(err)
assert.Nil(apiErr)
assert.NotNil(tok)
_, apiErr, err = org.Authenticate(ctx, "am_anything", "wrong", "wrong")
_, apiErr, err = org.Authenticate(ctx, "am_1234567890", "wrong", "wrong")
assert.NoError(err)
require.NotNil(t, apiErr)
assert.EqualValuesf(http.StatusUnauthorized, apiErr.Status, "Expected unauthenticated, got %q", apiErr.Message)
+3 -3
View File
@@ -14,7 +14,7 @@ import (
func TestProjects_List(t *testing.T) {
assert := assert.New(t)
tc := controller.NewTestController(t, nil)
tc := controller.NewTestController(t, &controller.TestControllerOpts{DisableAuthorizationFailures: true})
defer tc.Shutdown()
client := tc.Client()
@@ -68,7 +68,7 @@ func comparableSlice(in []*scopes.Project) []scopes.Project {
}
func TestProjects_Crud(t *testing.T) {
tc := controller.NewTestController(t, nil)
tc := controller.NewTestController(t, &controller.TestControllerOpts{DisableAuthorizationFailures: true})
defer tc.Shutdown()
client := tc.Client()
@@ -116,7 +116,7 @@ func TestProjects_Crud(t *testing.T) {
// TODO: Get better coverage for expected errors and error formats.
func TestProject_Errors(t *testing.T) {
assert := assert.New(t)
tc := controller.NewTestController(t, nil)
tc := controller.NewTestController(t, &controller.TestControllerOpts{DisableAuthorizationFailures: true})
defer tc.Shutdown()
ctx := tc.Context()
+3 -3
View File
@@ -17,7 +17,7 @@ import (
func TestUsers_List(t *testing.T) {
assert := assert.New(t)
tc := controller.NewTestController(t, nil)
tc := controller.NewTestController(t, &controller.TestControllerOpts{DisableAuthorizationFailures: true})
defer tc.Shutdown()
client := tc.Client()
@@ -73,7 +73,7 @@ func comparableSlice(in []*users.User) []users.User {
}
func TestUser_Crud(t *testing.T) {
tc := controller.NewTestController(t, nil)
tc := controller.NewTestController(t, &controller.TestControllerOpts{DisableAuthorizationFailures: true})
defer tc.Shutdown()
client := tc.Client()
@@ -124,7 +124,7 @@ func TestUser_Crud(t *testing.T) {
func TestUser_Errors(t *testing.T) {
assert := assert.New(t)
tc := controller.NewTestController(t, nil)
tc := controller.NewTestController(t, &controller.TestControllerOpts{DisableAuthorizationFailures: true})
defer tc.Shutdown()
ctx := tc.Context()