Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add variables to header_option integration test #3610

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading