-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: upgrade go.mod to 1.20 (matches Dockerfile builder) + ioutil d…
…eprecation Topic: 1.20 Relative: rm-reflection Signed-off-by: Ross Bryan <[email protected]>
- Loading branch information
1 parent
4c07622
commit 851c120
Showing
3 changed files
with
32 additions
and
3 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module github.com/quay/quay-bridge-operator | ||
|
||
go 1.17 | ||
go 1.20 | ||
|
||
require ( | ||
github.com/go-logr/logr v1.2.4 | ||
|
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
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package quay_test | ||
|
||
import ( | ||
"net/http" | ||
"testing" | ||
) | ||
|
||
func TestGetUser(t *testing.T) { | ||
// Create a new instance of the mock controller | ||
ctrl := quay.NewController(t) | ||
defer ctrl.Finish() | ||
|
||
// Create a mock instance of QuayClient | ||
mockQuayClient := mock_quay.NewMockQuayClient(ctrl) | ||
|
||
// Prepare expected user and response | ||
expectedUser := quay.User{} // Define your expected User struct here | ||
mockResponse := &http.Response{} // Mock HTTP response | ||
|
||
// Set up expectations | ||
mockQuayClient.EXPECT().GetUser().Return(expectedUser, mockResponse, nil) | ||
|
||
// Call the method under test | ||
user, resp, err := mockQuayClient.GetUser() | ||
|
||
// Assert the results | ||
assert.NoError(t, err) | ||
assert.Equal(t, expectedUser, user) | ||
assert.Equal(t, mockResponse, resp) | ||
} |