Skip to content

Commit 7fe0250

Browse files
committed
tests: check request
1 parent 2b2236d commit 7fe0250

4 files changed

Lines changed: 13 additions & 0 deletions

File tree

internal/app/enaptercli/execute_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,14 @@ func TestHTTPReqResp(t *testing.T) {
7373
if update {
7474
err := os.WriteFile(expReqFileName, shouldMarshalIndent(t, reqObj), 0o600)
7575
require.NoError(t, err)
76+
} else {
77+
require.Equal(t, readFileToString(t, expReqFileName), string(shouldMarshalIndent(t, reqObj)))
7678
}
7779

7880
resp := shouldReadFile(t, filepath.Join(testdataPath, tc.Name(), "resp_"+strconv.Itoa(reqCount)))
7981
_, _ = w.Write(resp)
82+
83+
reqCount++
8084
}))
8185
defer srv.Close()
8286

internal/app/enaptercli/testdata/http_req_resp/blueprint_inspect_by_id/req_0

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
"Accept-Encoding": [
66
"gzip"
77
],
8+
"Content-Type": [
9+
""
10+
],
811
"User-Agent": [
912
"Go-http-client/1.1"
1013
],

internal/app/enaptercli/testdata/http_req_resp/blueprint_inspect_by_name/req_0

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
"Accept-Encoding": [
66
"gzip"
77
],
8+
"Content-Type": [
9+
""
10+
],
811
"User-Agent": [
912
"Go-http-client/1.1"
1013
],

internal/app/enaptercli/testdata/http_req_resp/device_assign_blueprint/req_0

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
"Content-Length": [
99
"55"
1010
],
11+
"Content-Type": [
12+
"application/json"
13+
],
1114
"User-Agent": [
1215
"Go-http-client/1.1"
1316
],

0 commit comments

Comments
 (0)