forked from friendsofgo/killgrave
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add tests for variables in body file
Merge in OSSC/killgrave from feature/friendsofgoGH-175-reuse-path-variable-for-bodyfile to feat/friendsofgoGH-175-reuse-path-variable-for-bodyfile * commit '18e28e7f7c16c2a4fc670f2aae6b744a82c1be51': remove unused line test: add tests for variables in body file
- Loading branch information
Showing
6 changed files
with
133 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
internal/server/http/test/testdata/imposters_variables/gopher_variables.imp.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[ | ||
{ | ||
"request": { | ||
"method": "GET", | ||
"endpoint": "/gophers/{id:.*}", | ||
"headers": { | ||
"Content-Type": "application/json" | ||
} | ||
}, | ||
"response": { | ||
"status": 200, | ||
"headers": { | ||
"Content-Type": "application/json" | ||
}, | ||
"bodyFile": "test/testdata/imposters_variables/responses/gopher_{id}_response.json" | ||
} | ||
}, | ||
{ | ||
"request": { | ||
"method": "GET", | ||
"endpoint": "/gophers/{id:.*}/{second_id:.*}", | ||
"headers": { | ||
"Content-Type": "application/json" | ||
} | ||
}, | ||
"response": { | ||
"status": 200, | ||
"headers": { | ||
"Content-Type": "application/json" | ||
}, | ||
"bodyFile": "test/testdata/imposters_variables/responses/gopher_{id}_{second_id}_response.json" | ||
} | ||
} | ||
] |
11 changes: 11 additions & 0 deletions
11
internal/server/http/test/testdata/imposters_variables/responses/gopher_1_1_response.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"data": { | ||
"type": "gophers", | ||
"id": "1_1", | ||
"attributes": { | ||
"name": "Zebediah", | ||
"color": "Purple", | ||
"age": 54 | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
internal/server/http/test/testdata/imposters_variables/responses/gopher_1_2_response.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"data": { | ||
"type": "gophers", | ||
"id": "1_2", | ||
"attributes": { | ||
"name": "Zebediah", | ||
"color": "Purple", | ||
"age": 54 | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
internal/server/http/test/testdata/imposters_variables/responses/gopher_1_response.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"data": { | ||
"type": "gophers", | ||
"id": "1", | ||
"attributes": { | ||
"name": "Zebediah", | ||
"color": "Purple", | ||
"age": 54 | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
internal/server/http/test/testdata/imposters_variables/responses/gopher_2_response.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"data": { | ||
"type": "gophers", | ||
"id": "2", | ||
"attributes": { | ||
"name": "Zebediah", | ||
"color": "Purple", | ||
"age": 54 | ||
} | ||
} | ||
} |