From b411654d46b64996881d4364995b19f094cbb7b1 Mon Sep 17 00:00:00 2001 From: Nikita Koryabkin Date: Mon, 26 Feb 2024 10:22:31 +0300 Subject: [PATCH 1/2] fixed propagation of httpClient and jsonMarshaller for TableTests --- builder.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/builder.go b/builder.go index 5afabcc..56fff49 100644 --- a/builder.go +++ b/builder.go @@ -507,6 +507,14 @@ func (qt *cute) PutTests(params ...*Test) TableTest { } } + if qt.baseProps != nil && qt.baseProps.httpClient != nil { + param.httpClient = qt.baseProps.httpClient + } + + if qt.baseProps != nil && qt.baseProps.jsonMarshaler != nil { + param.jsonMarshaler = qt.baseProps.jsonMarshaler + } + qt.tests = append(qt.tests, param) qt.countTests++ } From 66bb16992d6b02bbefc28b0c9f4404985891a93c Mon Sep 17 00:00:00 2001 From: Nikita Koryabkin Date: Mon, 26 Feb 2024 13:48:35 +0300 Subject: [PATCH 2/2] fixed propagation of httpClient and jsonMarshaller for TableTests --- builder.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/builder.go b/builder.go index 56fff49..4fd5510 100644 --- a/builder.go +++ b/builder.go @@ -497,6 +497,14 @@ func (qt *cute) PutNewTest(name string, r *http.Request, expect *Expect) TableTe func (qt *cute) PutTests(params ...*Test) TableTest { for _, param := range params { + if qt.baseProps != nil && qt.baseProps.httpClient != nil { + param.httpClient = qt.baseProps.httpClient + } + + if qt.baseProps != nil && qt.baseProps.jsonMarshaler != nil { + param.jsonMarshaler = qt.baseProps.jsonMarshaler + } + // Validate, that first step is empty if qt.countTests == 0 { if qt.tests[0].Request.Base == nil && @@ -507,14 +515,6 @@ func (qt *cute) PutTests(params ...*Test) TableTest { } } - if qt.baseProps != nil && qt.baseProps.httpClient != nil { - param.httpClient = qt.baseProps.httpClient - } - - if qt.baseProps != nil && qt.baseProps.jsonMarshaler != nil { - param.jsonMarshaler = qt.baseProps.jsonMarshaler - } - qt.tests = append(qt.tests, param) qt.countTests++ }