Improve output integration test and add --no-output.

This commit is contained in:
jcamiel 2023-06-17 11:06:09 +02:00 committed by hurl-bot
parent 9f25a11fbc
commit f7d7c6c6e7
No known key found for this signature in database
GPG Key ID: 1283A2B4A0DCAF8D
11 changed files with 33 additions and 6 deletions

View 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 &lt;https://hurl.dev/docs/manual.html#no-output&gt;)</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>

View 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

View File

@ -0,0 +1 @@
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/no-output"},"response":{"status":200}}]}

View File

View File

@ -0,0 +1,3 @@
Set-StrictMode -Version latest
$ErrorActionPreference = 'Stop'
hurl --no-output tests_ok/no_output.hurl

View 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")

View File

@ -0,0 +1,3 @@
#!/bin/bash
set -Eeuo pipefail
hurl --no-output tests_ok/no_output.hurl

View File

@ -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 &lt;https://hurl.dev/docs/manual.html#output&gt;)</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>

View File

@ -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

View File

@ -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

View File

@ -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