Skip to content
This repository has been archived by the owner on Dec 22, 2022. It is now read-only.

Commit

Permalink
Minor changes to accounts test coverage (prebid#1475)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsardo authored Sep 8, 2020
1 parent 28515ad commit d707c7d
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions endpoints/openrtb2/auction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,13 +279,14 @@ func TestRejectAccountRequired(t *testing.T) {
},
{
// Account is required, was provided, not blacklisted and is a valid account
dir: "sample-requests/account-required",
file: "valid-acct.json",
payloadGetter: getRequestPayload,
messageGetter: nilReturner,
expectedCode: http.StatusOK,
aliased: true,
accountReq: true,
dir: "sample-requests/account-required",
file: "valid-acct.json",
payloadGetter: getRequestPayload,
messageGetter: nilReturner,
expectedCode: http.StatusOK,
aliased: true,
accountReq: true,
accountDefaultDisabled: true,
},
{
// Account is required, was provided in request and is found in the blacklisted accounts map
Expand Down Expand Up @@ -1996,10 +1997,10 @@ func TestGetAccount(t *testing.T) {
{accountID: unknown, required: true, disabled: true, err: &errortypes.AcctRequired{}},

// pubID given but is not a valid host account (does not exist)
{accountID: "not_bad_acct", required: false, disabled: false, err: nil},
{accountID: "not_bad_acct", required: true, disabled: false, err: nil},
{accountID: "not_bad_acct", required: false, disabled: true, err: &errortypes.BlacklistedAcct{}},
{accountID: "not_bad_acct", required: true, disabled: true, err: &errortypes.AcctRequired{}},
{accountID: "doesnt_exist_acct", required: false, disabled: false, err: nil},
{accountID: "doesnt_exist_acct", required: true, disabled: false, err: nil},
{accountID: "doesnt_exist_acct", required: false, disabled: true, err: &errortypes.BlacklistedAcct{}},
{accountID: "doesnt_exist_acct", required: true, disabled: true, err: &errortypes.AcctRequired{}},

// pubID given and matches a valid host account with Disabled: false
{accountID: "valid_acct", required: false, disabled: false, err: nil},
Expand Down

0 comments on commit d707c7d

Please sign in to comment.