Skip to content

Commit

Permalink
Test case for file/file_render to marshal pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Hinderberger committed Jun 4, 2024
1 parent 29c63c2 commit 367615d
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/filemarshal/dummy.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"foo": "{\n \"dummy\": \"data\"\n}\n"}
3 changes: 3 additions & 0 deletions test/filemarshal/dummy_template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"dummy": {{ printf `"data"` }}
}
11 changes: 11 additions & 0 deletions test/filemarshal/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"http_server": {
"addr": ":9999",
"dir": "./",
"testmode": false
},
"name": "ensure a file_render to JSON marshal pipe works as expected",
"tests": [
"@requests.json"
]
}
29 changes: 29 additions & 0 deletions test/filemarshal/requests.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[
{
"name": "file_render to marshal pipeline should pass",
"request": {
"server_url": "http://localhost:9999",
"endpoint": "dummy.txt",
"method": "GET"
},
"response": {
"body": {
"foo": {{ file_render "dummy_template.json" | marshal }}
}
}
},
{
"name": "file to marshal pipeline should fail",
"request": {
"server_url": "http://localhost:9999",
"endpoint": "dummy.txt",
"method": "GET"
},
"response": {
"body": {
"foo": {{ file "dummy_template.json" | marshal }}
}
},
"reverse_test_result": true
}
]

0 comments on commit 367615d

Please sign in to comment.