mirror of
https://github.com/Orange-OpenSource/hurl.git
synced 2024-11-27 08:19:22 +03:00
Improve output integration test and add --no-output.
This commit is contained in:
parent
9f25a11fbc
commit
f7d7c6c6e7
4
integration/tests_ok/no_output.html
Normal file
4
integration/tests_ok/no_output.html
Normal file
@ -0,0 +1,4 @@
|
||||
<pre><code class="language-hurl"><span class="hurl-entry"><span class="request"><span class="line"></span><span class="comment"># Test the option --no-output (see <https://hurl.dev/docs/manual.html#no-output>)</span>
|
||||
<span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/no-output</span></span>
|
||||
</span><span class="response"><span class="line"><span class="version">HTTP</span> <span class="number">200</span></span>
|
||||
</span></span></code></pre>
|
3
integration/tests_ok/no_output.hurl
Normal file
3
integration/tests_ok/no_output.hurl
Normal file
@ -0,0 +1,3 @@
|
||||
# Test the option --no-output (see <https://hurl.dev/docs/manual.html#no-output>)
|
||||
GET http://localhost:8000/no-output
|
||||
HTTP 200
|
1
integration/tests_ok/no_output.json
Normal file
1
integration/tests_ok/no_output.json
Normal file
@ -0,0 +1 @@
|
||||
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/no-output"},"response":{"status":200}}]}
|
0
integration/tests_ok/no_output.out
Executable file
0
integration/tests_ok/no_output.out
Executable file
3
integration/tests_ok/no_output.ps1
Normal file
3
integration/tests_ok/no_output.ps1
Normal file
@ -0,0 +1,3 @@
|
||||
Set-StrictMode -Version latest
|
||||
$ErrorActionPreference = 'Stop'
|
||||
hurl --no-output tests_ok/no_output.hurl
|
7
integration/tests_ok/no_output.py
Normal file
7
integration/tests_ok/no_output.py
Normal file
@ -0,0 +1,7 @@
|
||||
from app import app
|
||||
from flask import request
|
||||
|
||||
|
||||
@app.route("/no-output")
|
||||
def no_output():
|
||||
return app.response_class(headers={"date": "DATE1"}, response="Hello world!\n")
|
3
integration/tests_ok/no_output.sh
Executable file
3
integration/tests_ok/no_output.sh
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
set -Eeuo pipefail
|
||||
hurl --no-output tests_ok/no_output.hurl
|
@ -1,7 +1,7 @@
|
||||
<pre><code class="language-hurl"><span class="hurl-entry"><span class="request"><span class="line"><span class="method">POST</span> <span class="url">http://localhost:8000/output/endpoint1</span></span>
|
||||
<pre><code class="language-hurl"><span class="hurl-entry"><span class="request"><span class="line"></span><span class="comment"># Test the option --output (see <https://hurl.dev/docs/manual.html#output>)</span>
|
||||
<span class="line"><span class="method">POST</span> <span class="url">http://localhost:8000/output/endpoint1</span></span>
|
||||
<span class="json"><span class="line">{ "user": "bob" }</span></span>
|
||||
</span><span class="response"><span class="line"></span>
|
||||
<span class="line"><span class="version">HTTP</span> <span class="number">200</span></span>
|
||||
</span><span class="response"><span class="line"><span class="version">HTTP</span> <span class="number">200</span></span>
|
||||
</span></span><span class="hurl-entry"><span class="request"><span class="line"></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/output/endpoint2</span></span>
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Test the option --output (see <https://hurl.dev/docs/manual.html#output>)
|
||||
POST http://localhost:8000/output/endpoint1
|
||||
{ "user": "bob" }
|
||||
|
||||
HTTP 200
|
||||
|
||||
|
||||
|
@ -1,3 +1,7 @@
|
||||
Set-StrictMode -Version latest
|
||||
$ErrorActionPreference = 'Stop'
|
||||
hurl tests_ok/output.hurl
|
||||
if (Test-Path tests_ok/output.bin) {
|
||||
Remove-Item tests_ok/output.bin
|
||||
}
|
||||
hurl --output tests_ok/output.bin tests_ok/output.hurl
|
||||
Write-Host (Get-Content tests_ok/output.bin -Raw) -NoNewLine
|
||||
|
@ -1,3 +1,5 @@
|
||||
#!/bin/bash
|
||||
set -Eeuo pipefail
|
||||
hurl tests_ok/output.hurl
|
||||
rm -f tests_ok/output.bin
|
||||
hurl --output tests_ok/output.bin tests_ok/output.hurl
|
||||
cat tests_ok/output.bin
|
||||
|
Loading…
Reference in New Issue
Block a user