Skip to content

Commit

Permalink
Fix: Expect Array Overwrites in Imp FPD Tests (#3725)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsardo authored Jun 4, 2024
1 parent c4fde39 commit ecf3171
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
8 changes: 5 additions & 3 deletions exchange/exchangetest/imp-fpd-multiple-imp.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@
"audio": {
"maxduration": 20,
"durfloors": [{
"maxdur": 30
"mindur": 2,
"maxdur": 30,
"bidfloor": 20.0
}],
"poddur": 40
},
Expand Down Expand Up @@ -164,9 +166,9 @@
"minduration": 1,
"maxduration": 20,
"durfloors": [{
"mindur": 1,
"mindur": 2,
"maxdur": 30,
"bidfloor": 10.0
"bidfloor": 20.0
}],
"poddur": 40
},
Expand Down
16 changes: 8 additions & 8 deletions exchange/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ func TestSplitImps(t *testing.T) {
},
},
},
Ext: json.RawMessage(`{"prebid":{"bidder":{"bidderA":{"imp1paramA":"imp1valueA"}},"imp":{"bidderA":{"id":"impFPD", "banner":{"format":[{"h":30}]}}}}}`),
Ext: json.RawMessage(`{"prebid":{"bidder":{"bidderA":{"imp1paramA":"imp1valueA"}},"imp":{"bidderA":{"id":"impFPD", "banner":{"format":[{"w":30,"h":40}]}}}}}`),
},
},
expectedImps: map[string][]openrtb2.Imp{
Expand All @@ -240,8 +240,8 @@ func TestSplitImps(t *testing.T) {
Banner: &openrtb2.Banner{
Format: []openrtb2.Format{
{
W: 10,
H: 30,
W: 30,
H: 40,
},
},
},
Expand All @@ -264,7 +264,7 @@ func TestSplitImps(t *testing.T) {
},
},
},
Ext: json.RawMessage(`{"prebid":{"bidder":{"bidderB":{"imp1paramB":"imp1valueB"}},"imp":{"bidderA":{"id":"impFPD", "banner":{"format":[{"h":30}]}}}}}`),
Ext: json.RawMessage(`{"prebid":{"bidder":{"bidderB":{"imp1paramB":"imp1valueB"}},"imp":{"bidderA":{"id":"impFPD", "banner":{"format":[{"w":30,"h":40}]}}}}}`),
},
},
expectedImps: map[string][]openrtb2.Imp{
Expand Down Expand Up @@ -463,7 +463,7 @@ func TestMergeImpFPD(t *testing.T) {
{
W: 10,
H: 20,
Ext: json.RawMessage(`{"formatkey1":"formatval1", "formatkey2":"formatval2"}`),
Ext: json.RawMessage(`{"formatkey1":"formatval1"}`),
},
},
},
Expand All @@ -475,7 +475,7 @@ func TestMergeImpFPD(t *testing.T) {
IframeBuster: []string{"buster1", "buster2"},
Ext: json.RawMessage(`{"cool1":"test1", "cool2":"test2"}`),
},
fpd: json.RawMessage(`{"id": "id2", "metric": [{"type":"type2", "value":2, "vendor":"vendor2"}], "banner": {"w":100, "format": [{"w":1000, "ext":{"formatkey1":"formatval11"}}]}, "instl":2, "bidfloor":2, "ext":{"cool1":"test11"} }`),
fpd: json.RawMessage(`{"id": "id2", "metric": [{"type":"type2", "value":2, "vendor":"vendor2"}], "banner": {"w":100, "format": [{"w":1000, "h":2000, "ext":{"formatkey1":"formatval11"}}]}, "instl":2, "bidfloor":2, "ext":{"cool1":"test11"} }`),
wantImp: &openrtb2.Imp{
ID: "id2",
Metric: []openrtb2.Metric{{Type: "type2", Value: 2, Vendor: "vendor2"}},
Expand All @@ -485,8 +485,8 @@ func TestMergeImpFPD(t *testing.T) {
Format: []openrtb2.Format{
{
W: 1000,
H: 20,
Ext: json.RawMessage(`{"formatkey1":"formatval11","formatkey2":"formatval2"}`),
H: 2000,
Ext: json.RawMessage(`{"formatkey1":"formatval11"}`),
},
},
},
Expand Down

0 comments on commit ecf3171

Please sign in to comment.