-
Notifications
You must be signed in to change notification settings - Fork 742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CCPA Phase 1: Cookie Sync #1135
Changes from 3 commits
d0e1c16
ed19c20
ddc28ae
4856058
5f2e0a2
171402d
927f54f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,17 +4,24 @@ import ( | |
"testing" | ||
"text/template" | ||
|
||
"github.com/prebid/prebid-server/privacy" | ||
"github.com/prebid/prebid-server/privacy/gdpr" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestConsumableSyncer(t *testing.T) { | ||
syncURL := "//e.serverbid.com/udb/9969/match?redir=http%3A%2F%2Flocalhost%3A8000%2Fsetuid%3Fbidder%3Dconsumable%26gdpr%3D{{.GDPR}}%26gdpr_consent%3D{{.GDPRConsent}}%26uid%3D" | ||
syncURLTemplate := template.Must( | ||
template.New("sync-template").Parse(syncURL), | ||
) | ||
|
||
temp := template.Must(template.New("sync-template").Parse( | ||
"//e.serverbid.com/udb/9969/match?redir=http%3A%2F%2Flocalhost%3A8000%2Fsetuid%3Fbidder%3Dconsumable%26gdpr%3D{{.GDPR}}%26gdpr_consent%3D{{.GDPRConsent}}%26uid%3D")) | ||
syncer := NewConsumableSyncer(syncURLTemplate) | ||
u, _ := syncer.GetUsersyncInfo(privacy.Policies{ | ||
GDPR: gdpr.Policy{ | ||
Signal: "0", | ||
}, | ||
}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you think it'd be nice to not ignore the error and assert for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. I think it's a idea to keep it uniform. Fixed. |
||
|
||
syncer := NewConsumableSyncer(temp) | ||
|
||
u, _ := syncer.GetUsersyncInfo("0", "") | ||
assert.Equal(t, "//e.serverbid.com/udb/9969/match?redir=http%3A%2F%2Flocalhost%3A8000%2Fsetuid%3Fbidder%3Dconsumable%26gdpr%3D0%26gdpr_consent%3D%26uid%3D", u.URL) | ||
assert.Equal(t, "redirect", u.Type) | ||
assert.Equal(t, uint16(65535), syncer.GDPRVendorID()) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is a bit hard to read. Unified to an easier to read pattern. I originally had changes to these files, but that's been removed but I thought the refactor is nice to have.