-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename test case field to follow pattern
Signed-off-by: Matheus Pimenta <[email protected]>
- Loading branch information
1 parent
c373be7
commit 14e9fa0
Showing
1 changed file
with
16 additions
and
16 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 |
---|---|---|
|
@@ -673,11 +673,11 @@ func TestImageRepositoryReconciler_scan(t *testing.T) { | |
|
||
func TestImageRepositoryReconciler_getProxyURL(t *testing.T) { | ||
tests := []struct { | ||
name string | ||
repo *imagev1.ImageRepository | ||
objects []client.Object | ||
expectedURL string | ||
expectedErr string | ||
name string | ||
repo *imagev1.ImageRepository | ||
objects []client.Object | ||
wantURL string | ||
wantErr string | ||
}{ | ||
{ | ||
name: "empty proxySecretRef", | ||
|
@@ -696,7 +696,7 @@ func TestImageRepositoryReconciler_getProxyURL(t *testing.T) { | |
}, | ||
}, | ||
}, | ||
expectedErr: "secrets \"non-existing\" not found", | ||
wantErr: "secrets \"non-existing\" not found", | ||
}, | ||
{ | ||
name: "missing address in proxySecretRef", | ||
|
@@ -715,7 +715,7 @@ func TestImageRepositoryReconciler_getProxyURL(t *testing.T) { | |
Data: map[string][]byte{}, | ||
}, | ||
}, | ||
expectedErr: "invalid proxy secret '/dummy': key 'address' is missing", | ||
wantErr: "invalid proxy secret '/dummy': key 'address' is missing", | ||
}, | ||
{ | ||
name: "invalid address in proxySecretRef", | ||
|
@@ -736,7 +736,7 @@ func TestImageRepositoryReconciler_getProxyURL(t *testing.T) { | |
}, | ||
}, | ||
}, | ||
expectedErr: "failed to parse proxy address '\x7f': parse \"\\x7f\": net/url: invalid control character in URL", | ||
wantErr: "failed to parse proxy address '\x7f': parse \"\\x7f\": net/url: invalid control character in URL", | ||
}, | ||
{ | ||
name: "no user, no password", | ||
|
@@ -757,7 +757,7 @@ func TestImageRepositoryReconciler_getProxyURL(t *testing.T) { | |
}, | ||
}, | ||
}, | ||
expectedURL: "http://proxy.example.com", | ||
wantURL: "http://proxy.example.com", | ||
}, | ||
{ | ||
name: "user, no password", | ||
|
@@ -779,7 +779,7 @@ func TestImageRepositoryReconciler_getProxyURL(t *testing.T) { | |
}, | ||
}, | ||
}, | ||
expectedURL: "http://user:@proxy.example.com", | ||
wantURL: "http://user:@proxy.example.com", | ||
}, | ||
{ | ||
name: "no user, password", | ||
|
@@ -801,7 +801,7 @@ func TestImageRepositoryReconciler_getProxyURL(t *testing.T) { | |
}, | ||
}, | ||
}, | ||
expectedURL: "http://:[email protected]", | ||
wantURL: "http://:[email protected]", | ||
}, | ||
{ | ||
name: "user, password", | ||
|
@@ -824,7 +824,7 @@ func TestImageRepositoryReconciler_getProxyURL(t *testing.T) { | |
}, | ||
}, | ||
}, | ||
expectedURL: "http://user:[email protected]", | ||
wantURL: "http://user:[email protected]", | ||
}, | ||
} | ||
|
||
|
@@ -842,15 +842,15 @@ func TestImageRepositoryReconciler_getProxyURL(t *testing.T) { | |
} | ||
|
||
u, err := r.getProxyURL(ctx, tt.repo) | ||
if tt.expectedErr == "" { | ||
if tt.wantErr == "" { | ||
g.Expect(err).To(BeNil()) | ||
} else { | ||
g.Expect(err.Error()).To(ContainSubstring(tt.expectedErr)) | ||
g.Expect(err.Error()).To(ContainSubstring(tt.wantErr)) | ||
} | ||
if tt.expectedURL == "" { | ||
if tt.wantURL == "" { | ||
g.Expect(u).To(BeNil()) | ||
} else { | ||
g.Expect(u.String()).To(Equal(tt.expectedURL)) | ||
g.Expect(u.String()).To(Equal(tt.wantURL)) | ||
} | ||
}) | ||
} | ||
|