Skip to content

Commit

Permalink
Rename test parameter to emptyUID
Browse files Browse the repository at this point in the history
  • Loading branch information
EduardGomezEscandell committed Oct 25, 2023
1 parent 0adac69 commit bc4ba7e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions windows-agent/internal/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,14 @@ func TestSetSubscription(t *testing.T) {
mockErrors uint32
registryState registryState
accessIsReadOnly bool
setEmptyToken bool
emptyToken bool

want string
wantError bool
wantErrorType error
}{
"Success": {registryState: userTokenHasValue, want: "new_token"},
"Success disabling a subscription": {registryState: userTokenHasValue, setEmptyToken: true, want: ""},
"Success disabling a subscription": {registryState: userTokenHasValue, emptyToken: true, want: ""},
"Success when the key does not exist": {registryState: untouched, want: "new_token"},
"Success when the pro token field does not exist": {registryState: keyExists, want: "new_token"},
"Success when there is a store token active": {registryState: storeTokenHasValue, want: "store_token"},
Expand All @@ -259,7 +259,7 @@ func TestSetSubscription(t *testing.T) {
conf := config.New(ctx, config.WithRegistry(r))

token := "new_token"
if tc.setEmptyToken {
if tc.emptyToken {
token = ""
}

Expand Down Expand Up @@ -290,14 +290,14 @@ func TestSetLandscapeAgentUID(t *testing.T) {
mockErrors uint32
registryState registryState
accessIsReadOnly bool
setEmptyUID bool
emptyUID bool

want string
wantError bool
wantErrorType error
}{
"Success": {registryState: landscapeAgentUIDHasValue, want: "new_uid"},
"Success unsetting the UID": {registryState: landscapeAgentUIDHasValue, setEmptyUID: true, want: ""},
"Success unsetting the UID": {registryState: landscapeAgentUIDHasValue, emptyUID: true, want: ""},
"Success when the key does not exist": {registryState: untouched, want: "new_uid"},
"Success when the pro token field does not exist": {registryState: keyExists, want: "new_uid"},

Expand All @@ -317,7 +317,7 @@ func TestSetLandscapeAgentUID(t *testing.T) {
conf := config.New(ctx, config.WithRegistry(r))

uid := "new_uid"
if tc.setEmptyUID {
if tc.emptyUID {
uid = ""
}

Expand Down

0 comments on commit bc4ba7e

Please sign in to comment.