Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bsardo committed Jul 26, 2024
1 parent bb20271 commit 45d1f05
Show file tree
Hide file tree
Showing 17 changed files with 1,062 additions and 314 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{
"mockBidRequest": {
"id": "test-request-id",
"app": {
"publisher": {
"id": "foo",
"name": "foo",
"domain": "msn.com"
}
},
"imp": [{
"native": {
"request": "{\"plcmtcnt\":1,\"plcmttype\":2,\"privacy\":1,\"context\":1,\"contextsubtype\":12,\"eventtrackers\":[{\"event\":1,\"methods\":[1,2]},{\"event\":2,\"methods\":[1]}],\"assets\":[{\"data\":{\"type\":12},\"required\":1},{\"title\":{\"len\":50},\"required\":1},{\"img\":{\"w\":80,\"h\":80,\"type\":1},\"required\":1},{\"img\":{\"w\":1200,\"h\":627,\"type\":3},\"required\":1},{\"data\":{\"type\":3},\"required\":0},{\"data\":{\"len\":100,\"type\":2},\"required\":1},{\"video\":{\"mimes\":[\"video/mpeg\",\"video/mp4\"],\"minduration\":2,\"protocols\":[2,5],\"maxduration\":2,\"ext\":{\"playbackmethod\":[1,2]}},\"required\":1}],\"ver\":\"1.2\"}"
},
"id": "test-imp-id",
"ext": {
"bidder": {
"inventoryCode": "foo",
"floor": 20
},
"data": {
"tag_code": ""
}
}
}]
},
"httpCalls": [{
"expectedRequest": {
"uri": "http://tlx.3lift.net/s2sn/auction?supplier_id=20",
"body": {
"id": "test-request-id",
"imp": [{
"id": "test-imp-id",
"native": {
"request": "{\"plcmtcnt\":1,\"plcmttype\":2,\"privacy\":1,\"context\":1,\"contextsubtype\":12,\"eventtrackers\":[{\"event\":1,\"methods\":[1,2]},{\"event\":2,\"methods\":[1]}],\"assets\":[{\"data\":{\"type\":12},\"required\":1},{\"title\":{\"len\":50},\"required\":1},{\"img\":{\"w\":80,\"h\":80,\"type\":1},\"required\":1},{\"img\":{\"w\":1200,\"h\":627,\"type\":3},\"required\":1},{\"data\":{\"type\":3},\"required\":0},{\"data\":{\"len\":100,\"type\":2},\"required\":1},{\"video\":{\"mimes\":[\"video/mpeg\",\"video/mp4\"],\"minduration\":2,\"protocols\":[2,5],\"maxduration\":2,\"ext\":{\"playbackmethod\":[1,2]}},\"required\":1}],\"ver\":\"1.2\"}"
},
"tagid": "foo",
"bidfloor": 20,
"ext": {
"bidder": {
"inventoryCode": "foo",
"floor": 20
},
"data": {
"tag_code": ""
}
}
}],
"app": {
"publisher": {
"id": "foo",
"name": "foo",
"domain": "msn.com"
}
}
},
"impIDs": ["test-imp-id"]
},
"mockResponse": {
"status": 200,
"body": {
"id": "test-request-id",
"seatbid": [{
"seat": "958",
"bid": [{
"id": "7706636740145184841",
"impid": "test-imp-id",
"price": 0.5,
"adid": "29681110",
"adm": "some-test-ad",
"adomain": [
"triplelift.com"
],
"iurl": "http://example.com",
"cid": "958",
"crid": "29681110",
"h": 250,
"w": 300,
"ext": "aaa"
}]
}],
"bidid": "5778926625248726496",
"cur": "USD"
}
}
}],
"expectedBidResponses": [{
"currency": "USD",
"bids": [{
"id": "test-request-id",
"type": "native",
"bid": {
"id": "7706636740145184841",
"impid": "test-imp-id",
"price": 0.5,
"adid": "29681110",
"adm": "some-test-ad",
"adomain": [
"triplelift.com"
],
"iurl": "http://example.com",
"cid": "958",
"crid": "29681110",
"h": 250,
"w": 300,
"ext": "aaa"
},
"bidid": "5778926625248726496",
"cur": "USD"
}]
}]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{
"mockBidRequest": {
"id": "test-request-id",
"app": {
"publisher": {
"id": "foo",
"name": "foo",
"domain": "msn.com"
}
},
"imp": [{
"native": {
"request": "{\"plcmtcnt\":1,\"plcmttype\":2,\"privacy\":1,\"context\":1,\"contextsubtype\":12,\"eventtrackers\":[{\"event\":1,\"methods\":[1,2]},{\"event\":2,\"methods\":[1]}],\"assets\":[{\"data\":{\"type\":12},\"required\":1},{\"title\":{\"len\":50},\"required\":1},{\"img\":{\"w\":80,\"h\":80,\"type\":1},\"required\":1},{\"img\":{\"w\":1200,\"h\":627,\"type\":3},\"required\":1},{\"data\":{\"type\":3},\"required\":0},{\"data\":{\"len\":100,\"type\":2},\"required\":1},{\"video\":{\"mimes\":[\"video/mpeg\",\"video/mp4\"],\"minduration\":2,\"protocols\":[2,5],\"maxduration\":2,\"ext\":{\"playbackmethod\":[1,2]}},\"required\":1}],\"ver\":\"1.2\"}"
},
"id": "test-imp-id",
"ext": {
"bidder": {
"inventoryCode": "foo",
"floor": 20
},
"data": {
"tag_code": "bar"
}
}
}]
},
"httpCalls": [{
"expectedRequest": {
"uri": "http://tlx.3lift.net/s2sn/auction?supplier_id=20",
"body": {
"id": "test-request-id",
"imp": [{
"id": "test-imp-id",
"native": {
"request": "{\"plcmtcnt\":1,\"plcmttype\":2,\"privacy\":1,\"context\":1,\"contextsubtype\":12,\"eventtrackers\":[{\"event\":1,\"methods\":[1,2]},{\"event\":2,\"methods\":[1]}],\"assets\":[{\"data\":{\"type\":12},\"required\":1},{\"title\":{\"len\":50},\"required\":1},{\"img\":{\"w\":80,\"h\":80,\"type\":1},\"required\":1},{\"img\":{\"w\":1200,\"h\":627,\"type\":3},\"required\":1},{\"data\":{\"type\":3},\"required\":0},{\"data\":{\"len\":100,\"type\":2},\"required\":1},{\"video\":{\"mimes\":[\"video/mpeg\",\"video/mp4\"],\"minduration\":2,\"protocols\":[2,5],\"maxduration\":2,\"ext\":{\"playbackmethod\":[1,2]}},\"required\":1}],\"ver\":\"1.2\"}"
},
"tagid": "bar",
"bidfloor": 20,
"ext": {
"bidder": {
"inventoryCode": "foo",
"floor": 20
},
"data": {
"tag_code": "bar"
}
}
}],
"app": {
"publisher": {
"id": "foo",
"name": "foo",
"domain": "msn.com"
}
}
},
"impIDs": ["test-imp-id"]
},
"mockResponse": {
"status": 200,
"body": {
"id": "test-request-id",
"seatbid": [{
"seat": "958",
"bid": [{
"id": "7706636740145184841",
"impid": "test-imp-id",
"price": 0.5,
"adid": "29681110",
"adm": "some-test-ad",
"adomain": [
"triplelift.com"
],
"iurl": "http://example.com",
"cid": "958",
"crid": "29681110",
"h": 250,
"w": 300,
"ext": "aaa"
}]
}],
"bidid": "5778926625248726496",
"cur": "USD"
}
}
}],
"expectedBidResponses": [{
"currency": "USD",
"bids": [{
"id": "test-request-id",
"type": "native",
"bid": {
"id": "7706636740145184841",
"impid": "test-imp-id",
"price": 0.5,
"adid": "29681110",
"adm": "some-test-ad",
"adomain": [
"triplelift.com"
],
"iurl": "http://example.com",
"cid": "958",
"crid": "29681110",
"h": 250,
"w": 300,
"ext": "aaa"
},
"bidid": "5778926625248726496",
"cur": "USD"
}]
}]
}
112 changes: 112 additions & 0 deletions adapters/triplelift_native/triplelift_nativetest/exemplary/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{
"mockBidRequest": {
"id": "test-request-id",
"app": {
"publisher": {
"id": "foo",
"name": "foo",
"domain": "foo.com"
}
},
"imp": [{
"native": {
"request": "{\"plcmtcnt\":1,\"plcmttype\":2,\"privacy\":1,\"context\":1,\"contextsubtype\":12,\"eventtrackers\":[{\"event\":1,\"methods\":[1,2]},{\"event\":2,\"methods\":[1]}],\"assets\":[{\"data\":{\"type\":12},\"required\":1},{\"title\":{\"len\":50},\"required\":1},{\"img\":{\"w\":80,\"h\":80,\"type\":1},\"required\":1},{\"img\":{\"w\":1200,\"h\":627,\"type\":3},\"required\":1},{\"data\":{\"type\":3},\"required\":0},{\"data\":{\"len\":100,\"type\":2},\"required\":1},{\"video\":{\"mimes\":[\"video/mpeg\",\"video/mp4\"],\"minduration\":2,\"protocols\":[2,5],\"maxduration\":2,\"ext\":{\"playbackmethod\":[1,2]}},\"required\":1}],\"ver\":\"1.2\"}"
},
"id": "test-imp-id",
"ext": {
"bidder": {
"inventoryCode": "foo",
"floor": 20
},
"data": {
"tag_code": "bar"
}
}
}]
},
"httpCalls": [{
"expectedRequest": {
"uri": "http://tlx.3lift.net/s2sn/auction?supplier_id=20",
"body": {
"id": "test-request-id",
"imp": [{
"id": "test-imp-id",
"native": {
"request": "{\"plcmtcnt\":1,\"plcmttype\":2,\"privacy\":1,\"context\":1,\"contextsubtype\":12,\"eventtrackers\":[{\"event\":1,\"methods\":[1,2]},{\"event\":2,\"methods\":[1]}],\"assets\":[{\"data\":{\"type\":12},\"required\":1},{\"title\":{\"len\":50},\"required\":1},{\"img\":{\"w\":80,\"h\":80,\"type\":1},\"required\":1},{\"img\":{\"w\":1200,\"h\":627,\"type\":3},\"required\":1},{\"data\":{\"type\":3},\"required\":0},{\"data\":{\"len\":100,\"type\":2},\"required\":1},{\"video\":{\"mimes\":[\"video/mpeg\",\"video/mp4\"],\"minduration\":2,\"protocols\":[2,5],\"maxduration\":2,\"ext\":{\"playbackmethod\":[1,2]}},\"required\":1}],\"ver\":\"1.2\"}"
},
"tagid": "foo",
"bidfloor": 20,
"ext": {
"bidder": {
"inventoryCode": "foo",
"floor": 20
},
"data": {
"tag_code": "bar"
}
}
}],
"app": {
"publisher": {
"id": "foo",
"name": "foo",
"domain": "foo.com"
}
}
},
"impIDs": ["test-imp-id"]
},
"mockResponse": {
"status": 200,
"body": {
"id": "test-request-id",
"seatbid": [{
"seat": "958",
"bid": [{
"id": "7706636740145184841",
"impid": "test-imp-id",
"price": 0.5,
"adid": "29681110",
"adm": "some-test-ad",
"adomain": [
"triplelift.com"
],
"iurl": "http://example.com",
"cid": "958",
"crid": "29681110",
"h": 250,
"w": 300,
"ext": "aaa"
}]
}],
"bidid": "5778926625248726496",
"cur": "USD"
}
}
}],
"expectedBidResponses": [{
"currency": "USD",
"bids": [{
"id": "test-request-id",
"type": "native",
"bid": {
"id": "7706636740145184841",
"impid": "test-imp-id",
"price": 0.5,
"adid": "29681110",
"adm": "some-test-ad",
"adomain": [
"triplelift.com"
],
"iurl": "http://example.com",
"cid": "958",
"crid": "29681110",
"h": 250,
"w": 300,
"ext": "aaa"
},
"bidid": "5778926625248726496",
"cur": "USD"
}]
}]
}
Loading

0 comments on commit 45d1f05

Please sign in to comment.