Skip to content

Commit

Permalink
Add variables to header_option integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
theoforger authored and hurl-bot committed Jan 20, 2025
1 parent 07e2fc7 commit 198f72c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
10 changes: 6 additions & 4 deletions integration/hurl/tests_ok/header_option.hurl
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
GET http://localhost:8000/header-option
test: from-header-syntax
key: from-header-syntax
[Options]
header: test: from-option-1
header: test: from-option-2
header: another-test: from-option
header: key: from-option-1
header: key: from-option-2
header: {{my_header}}
header: {{my_key}}: {{my_value}}
header: another-key: another-from-option
HTTP 200
2 changes: 1 addition & 1 deletion integration/hurl/tests_ok/header_option.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Set-StrictMode -Version latest
$ErrorActionPreference = 'Stop'

hurl tests_ok/header_option.hurl --header 'test: from-cli'
hurl tests_ok/header_option.hurl --header 'key: from-cli' --variable my_header='key: from-variable' --variable my_key=key-from-variable --variable my_value=value-from-variable
7 changes: 4 additions & 3 deletions integration/hurl/tests_ok/header_option.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
@app.route("/header-option")
def header_option():
assert (
request.headers.get("test")
== "from-header-syntax,from-cli,from-option-1,from-option-2"
request.headers.get("key")
== "from-header-syntax,from-cli,from-option-1,from-option-2,from-variable"
)
assert request.headers.get("another-test") == "from-option"
assert request.headers.get("another-key") == "another-from-option"
assert request.headers.get("key-from-variable") == "value-from-variable"
return ""
2 changes: 1 addition & 1 deletion integration/hurl/tests_ok/header_option.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
set -Eeuo pipefail

hurl tests_ok/header_option.hurl --header 'test: from-cli'
hurl tests_ok/header_option.hurl --header 'key: from-cli' --variable my_header='key: from-variable' --variable my_key=key-from-variable --variable my_value=value-from-variable

0 comments on commit 198f72c

Please sign in to comment.