forked from prebid/prebid-server
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsyncer_test.go
More file actions
36 lines (30 loc) · 738 Bytes
/
syncer_test.go
File metadata and controls
36 lines (30 loc) · 738 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package adapters
import (
"testing"
"text/template"
"github.com/prebid/prebid-server/privacy"
"github.com/prebid/prebid-server/privacy/ccpa"
"github.com/prebid/prebid-server/privacy/gdpr"
"github.com/stretchr/testify/assert"
)
func TestGetUsersyncInfo(t *testing.T) {
privacyPolicies := privacy.Policies{
GDPR: gdpr.Policy{
Signal: "A",
Consent: "B",
},
CCPA: ccpa.Policy{
Value: "C",
},
}
syncURL := "{{.GDPR}}{{.GDPRConsent}}{{.USPrivacy}}"
syncURLTemplate := template.Must(
template.New("sync-template").Parse(syncURL),
)
syncer := Syncer{
urlTemplate: syncURLTemplate,
}
syncInfo, err := syncer.GetUsersyncInfo(privacyPolicies)
assert.NoError(t, err)
assert.Equal(t, "ABC", syncInfo.URL)
}