mirror of
https://github.com/Orange-OpenSource/hurl.git
synced 2024-11-28 04:13:33 +03:00
Merge pull request #246 from Orange-OpenSource/feature/remove-unnecessay_checks
Remove unnecessary checks
This commit is contained in:
commit
36edc50923
@ -3,6 +3,7 @@
|
|||||||
# The file is parsed and output exactly as the input
|
# The file is parsed and output exactly as the input
|
||||||
#
|
#
|
||||||
import codecs
|
import codecs
|
||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
@ -17,11 +18,13 @@ def decode_string(encoded):
|
|||||||
|
|
||||||
|
|
||||||
def test(format_type, hurl_file):
|
def test(format_type, hurl_file):
|
||||||
|
output_file = hurl_file.replace('.hurl','.' + format_type)
|
||||||
|
if not os.path.exists(output_file):
|
||||||
|
return
|
||||||
cmd = ['hurlfmt', '--format', format_type, hurl_file]
|
cmd = ['hurlfmt', '--format', format_type, hurl_file]
|
||||||
print(' '.join(cmd))
|
print(' '.join(cmd))
|
||||||
result = subprocess.run(cmd, stdout=subprocess.PIPE)
|
result = subprocess.run(cmd, stdout=subprocess.PIPE)
|
||||||
json_file = hurl_file.replace('.hurl','.' + format_type)
|
expected = open(output_file, encoding='utf-8').read().strip()
|
||||||
expected = open(json_file, encoding='utf-8').read().strip()
|
|
||||||
actual = decode_string(result.stdout)
|
actual = decode_string(result.stdout)
|
||||||
if actual != expected:
|
if actual != expected:
|
||||||
print('>>> error in stdout')
|
print('>>> error in stdout')
|
||||||
|
@ -1 +0,0 @@
|
|||||||
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="comment"># Test body response with line ending LF and CRLF.</span></span><span class="line"><span class="comment"># We receive the text body "line1\nline2\r\nline3\n"</span></span><span class="line"><span class="comment"># and not "line1\nline2\nline3\n"</span></span><span class="line"></span><span class="line"><span class="comment">#</span></span><span class="line"><span class="comment"># $ printf "line1\nline2\nline3\n" | base64</span></span><span class="line"><span class="comment"># bGluZTEKbGluZTIKbGluZTMK</span></span><span class="line"></span><span class="line"></span><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/assert-base64</span></span></div><div class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span><span class="line"><span>base64,bGluZTEKbGluZTIKbGluZTMK;</span></span></div></div><span class="line"></span></div>
|
|
@ -1 +0,0 @@
|
|||||||
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/assert-base64"},"response":{"version":"HTTP/1.0","status":200,"body":{"encoding":"base64","value":"bGluZTEKbGluZTIKbGluZTMK"}}}]}
|
|
@ -1 +0,0 @@
|
|||||||
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/error-assert-bytearray</span></span></div><div class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span><span class="line section-header">[Asserts]</span><span class="line"><span class="query-type">bytes</span> <span class="predicate-type">equals</span> <span class="hex">hex,00;</span></span><span class="line"><span class="query-type">sha256</span> <span class="predicate-type">equals</span> <span class="hex">hex,a8100ae6aa1940d0b663bb31cd466142ebbdbd5187131b92d93818987832eb88;</span></span></div></div></div>
|
|
@ -1 +0,0 @@
|
|||||||
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/error-assert-bytearray"},"response":{"version":"HTTP/1.0","status":200,"asserts":[{"query":{"type":"bytes"},"predicate":{"type":"equal","value":"AA==","encoding":"base64"}},{"query":{"type":"sha256"},"predicate":{"type":"equal","value":"qBAK5qoZQNC2Y7sxzUZhQuu9vVGHExuS2TgYmHgy64g=","encoding":"base64"}}]}}]}
|
|
@ -1 +0,0 @@
|
|||||||
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="comment"># Return an unsupported content encoding</span></span><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/error/content-encoding</span></span></div><div class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span><span class="line">```Hello World!```</span></div></div></div>
|
|
@ -1 +0,0 @@
|
|||||||
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/error/content-encoding"},"response":{"version":"HTTP/1.0","status":200,"body":{"type":"raw-string","value":"Hello World!"}}}]}
|
|
@ -1 +0,0 @@
|
|||||||
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/error-assert-decompress</span></span></div><div class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span><span class="line">```Hello World!```</span></div></div><span class="line"></span></div>
|
|
@ -1 +0,0 @@
|
|||||||
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/error-assert-decompress"},"response":{"version":"HTTP/1.0","status":200,"body":{"type":"raw-string","value":"Hello World!"}}}]}
|
|
@ -1 +0,0 @@
|
|||||||
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="comment"># Test body response with file assertion.</span></span><span class="line"><span class="comment"># We receive the body "Hello" and not "Hello World!"</span></span><span class="line"></span><span class="line"></span><span class="line"></span><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/error-assert-file</span></span></div><div class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span><span class="line"><span>file,data.txt;</span></span></div></div><span class="line"></span></div>
|
|
@ -1 +0,0 @@
|
|||||||
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/error-assert-file"},"response":{"version":"HTTP/1.0","status":200,"body":{"type":"file","filename":"data.txt"}}}]}
|
|
@ -1 +0,0 @@
|
|||||||
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/error-assert-header-not-found</span></span></div><div class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span><span class="line"><span class="string">Custom</span><span>:</span> <span class="string">???</span></span></div></div></div>
|
|
@ -1 +0,0 @@
|
|||||||
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/error-assert-header-not-found"},"response":{"version":"HTTP/1.0","status":200,"headers":[{"name":"Custom","value":"???"}]}}]}
|
|
@ -1 +0,0 @@
|
|||||||
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/error-assert-header-value</span></span></div><div class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span><span class="line"><span class="string">Content-Type</span><span>:</span> <span class="string">???</span></span></div></div><div class="hurl-entry"><div class="request"><span class="line"></span><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/error-assert-header-value</span></span></div><div class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span><span class="line"><span class="string">Content-Type</span><span>:</span> <span class="string">???</span></span></div></div></div>
|
|
@ -1 +0,0 @@
|
|||||||
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/error-assert-header-value"},"response":{"version":"HTTP/1.0","status":200,"headers":[{"name":"Content-Type","value":"???"}]}},{"request":{"method":"GET","url":"http://localhost:8000/error-assert-header-value"},"response":{"version":"HTTP/1.0","status":200,"headers":[{"name":"Content-Type","value":"???"}]}}]}
|
|
@ -1 +0,0 @@
|
|||||||
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/error-assert/http-version</span></span></div><div class="response"><span class="line"><span class="version">HTTP/2</span> <span class="status">200</span></span></div></div><span class="line"></span></div>
|
|
@ -1 +0,0 @@
|
|||||||
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/error-assert/http-version"},"response":{"version":"HTTP/2","status":200}}]}
|
|
@ -1 +0,0 @@
|
|||||||
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/error-assert-invalid-predicate-type</span></span></div><div class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span><span class="line section-header">[Asserts]</span><span class="line"><span class="query-type">header</span> <span class="string">"content-type"</span> <span class="predicate-type">equals</span> <span class="number">1</span></span></div></div><span class="line"></span></div>
|
|
@ -1 +0,0 @@
|
|||||||
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/error-assert-invalid-predicate-type"},"response":{"version":"HTTP/1.0","status":200,"asserts":[{"query":{"type":"header","name":"content-type"},"predicate":{"type":"equal","value":1}}]}}]}
|
|
@ -1 +0,0 @@
|
|||||||
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/error-assert/match-utf8</span></span></div><div class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span><span class="line section-header">[Asserts]</span><span class="line"><span class="query-type">status</span> <span class="predicate-type">matches</span> <span class="string">".*"</span></span></div></div><span class="line"></span></div>
|
|
@ -1 +0,0 @@
|
|||||||
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/error-assert/match-utf8"},"response":{"version":"HTTP/1.0","status":200,"asserts":[{"query":{"type":"body"},"predicate":{"type":"match","value":".*"}}]}}]}
|
|
@ -1 +0,0 @@
|
|||||||
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/error-assert-query-cookie</span></span></div><div class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span><span class="line"></span><span class="line section-header">[Asserts]</span><span class="line"></span><span class="line"><span class="query-type">cookie</span> <span class="string">"cookie1[Secure]"</span> not <span class="predicate-type">exists</span></span><span class="line"><span class="query-type">cookie</span> <span class="string">"cookie1[Secure]"</span> <span class="predicate-type">equals</span> <span class="boolean">false</span></span><span class="line"><span class="query-type">cookie</span> <span class="string">"cookie1[Secure]"</span> not <span class="predicate-type">equals</span> <span class="boolean">true</span></span><span class="line"></span><span class="line"><span class="query-type">cookie</span> <span class="string">"cookie2[Secure]"</span> <span class="predicate-type">exists</span></span><span class="line"><span class="query-type">cookie</span> <span class="string">"cookie2[Secure]"</span> <span class="predicate-type">equals</span> <span class="boolean">true</span></span><span class="line"><span class="query-type">cookie</span> <span class="string">"cookie2[Secure]"</span> not <span class="predicate-type">equals</span> <span class="boolean">true</span></span></div></div><span class="line"></span><span class="line"></span><span class="line"></span></div>
|
|
@ -1 +0,0 @@
|
|||||||
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/error-assert-query-cookie"},"response":{"version":"HTTP/1.0","status":200,"asserts":[{"query":{"type":"cookie","expr":"cookie1[Secure]"},"predicate":{"not":true,"type":"exist"}},{"query":{"type":"cookie","expr":"cookie1[Secure]"},"predicate":{"type":"equal","value":false}},{"query":{"type":"cookie","expr":"cookie1[Secure]"},"predicate":{"not":true,"type":"equal","value":true}},{"query":{"type":"cookie","expr":"cookie2[Secure]"},"predicate":{"type":"exist"}},{"query":{"type":"cookie","expr":"cookie2[Secure]"},"predicate":{"type":"equal","value":true}},{"query":{"type":"cookie","expr":"cookie2[Secure]"},"predicate":{"not":true,"type":"equal","value":true}}]}}]}
|
|
@ -1 +0,0 @@
|
|||||||
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/error-assert-query-invalid-regex</span></span></div><div class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span><span class="line section-header">[Asserts]</span><span class="line"><span class="query-type">regex</span> <span class="string">"[x"</span> <span class="predicate-type">exists</span></span></div></div></div>
|
|
@ -1 +0,0 @@
|
|||||||
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/error-assert-query-invalid-regex"},"response":{"version":"HTTP/1.0","status":200,"asserts":[{"query":{"type":"regex","expr":"[x"},"predicate":{"type":"exist"}}]}}]}
|
|
@ -1 +0,0 @@
|
|||||||
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/utf8</span></span></div><div class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span><span class="line section-header">[Asserts]</span><span class="line"><span class="query-type">xpath</span> <span class="string">"//"</span> <span class="predicate-type">equals</span> <span class="number">1</span></span></div></div></div>
|
|
@ -1 +0,0 @@
|
|||||||
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/utf8"},"response":{"version":"HTTP/1.0","status":200,"asserts":[{"query":{"type":"xpath","expr":"//"},"predicate":{"type":"equal","value":1}}]}}]}
|
|
@ -1 +0,0 @@
|
|||||||
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/not_found</span></span></div><div class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span></div></div><span class="line"></span></div>
|
|
@ -1 +0,0 @@
|
|||||||
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/not_found"},"response":{"version":"HTTP/1.0","status":200}}]}
|
|
@ -1 +0,0 @@
|
|||||||
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/error-assert-template-variable-not-found</span></span></div><div class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span><span class="line section-header">[Asserts]</span><span class="line"><span class="query-type">header</span> <span class="string">"content-type"</span> <span class="predicate-type">equals</span> <span class="string">"{{content_type}}"</span></span></div></div><span class="line"></span></div>
|
|
@ -1 +0,0 @@
|
|||||||
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/error-assert-template-variable-not-found"},"response":{"version":"HTTP/1.0","status":200,"asserts":[{"query":{"type":"header","name":"content-type"},"predicate":{"type":"equal","value":"{{content_type}}"}}]}}]}
|
|
@ -1 +0,0 @@
|
|||||||
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/error-assert-value</span></span></div><div class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span><span class="line section-header">[Asserts]</span><span class="line"><span class="query-type">header</span> <span class="string">"content-type"</span> <span class="predicate-type">equals</span> <span class="string">"XXX"</span></span><span class="line"><span class="query-type">header</span> <span class="string">"content-type"</span> <span class="predicate-type">notEquals</span> <span class="string">"text/html; charset=utf-8"</span></span><span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.id"</span> <span class="predicate-type">equals</span> <span class="string">"000001"</span></span><span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.values"</span> <span class="predicate-type">includes</span> <span class="number">100</span></span><span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.values"</span> not <span class="predicate-type">contains</span> <span class="string">"Hello"</span></span><span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.count"</span> <span class="predicate-type">greaterThan</span> <span class="number">5</span></span><span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.count"</span> <span class="predicate-type">isFloat</span></span><span class="line"><span class="query-type">bytes</span> <span class="predicate-type">contains</span> <span class="hex">hex,00;</span></span></div></div></div>
|
|
@ -1 +0,0 @@
|
|||||||
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/error-assert-value"},"response":{"version":"HTTP/1.0","status":200,"asserts":[{"query":{"type":"header","name":"content-type"},"predicate":{"type":"equal","value":"XXX"}},{"query":{"type":"header","name":"content-type"},"predicate":{"type":"not-equal","value":"text/html; charset=utf-8"}},{"query":{"type":"jsonpath","expr":"$.id"},"predicate":{"type":"equal","value":"000001"}},{"query":{"type":"jsonpath","expr":"$.values"},"predicate":{"type":"include","value":100}},{"query":{"type":"jsonpath","expr":"$.values"},"predicate":{"not":true,"type":"contain","value":"Hello"}},{"query":{"type":"jsonpath","expr":"$.count"},"predicate":{"type":"greater","value":5}},{"query":{"type":"jsonpath","expr":"$.count"},"predicate":{"type":"isFloat"}},{"query":{"type":"bytes"},"predicate":{"type":"contain","value":"AA==","encoding":"base64"}}]}}]}
|
|
@ -1 +0,0 @@
|
|||||||
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/error-assert-variable</span></span></div><div class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span><span class="line section-header">[Captures]</span><span class="line">status<span>:</span> <span class="query-type">status</span></span><span class="line">length<span>:</span> <span class="query-type">header</span> <span class="string">"content-length"</span></span><span class="line">type<span>:</span> <span class="query-type">header</span> <span class="string">"content-type"</span></span><span class="line section-header">[Asserts]</span><span class="line"><span class="query-type">variable</span> <span class="string">"toto"</span> <span class="predicate-type">equals</span> <span class="string">"tata"</span></span><span class="line"><span class="query-type">variable</span> <span class="string">"status"</span> <span class="predicate-type">equals</span> <span class="expr">{{unknown}}</span></span><span class="line"><span class="query-type">variable</span> <span class="string">"status"</span> <span class="predicate-type">equals</span> <span class="expr">{{type}}</span></span><span class="line"><span class="query-type">variable</span> <span class="string">"status"</span> <span class="predicate-type">equals</span> <span class="expr">{{length}}</span></span></div></div></div>
|
|
@ -1 +0,0 @@
|
|||||||
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/error-assert-variable"},"response":{"version":"HTTP/1.0","status":200,"captures":[{"name":"status","query":{"type":"status"}},{"name":"length","query":{"type":"header","name":"content-length"}},{"name":"type","query":{"type":"header","name":"content-type"}}],"asserts":[{"query":{"type":"variable","name":"toto"},"predicate":{"type":"equal","value":"tata"}},{"query":{"type":"variable","name":"status"},"predicate":{"type":"equal","value":"unknown"}},{"query":{"type":"variable","name":"status"},"predicate":{"type":"equal","value":"type"}},{"query":{"type":"variable","name":"status"},"predicate":{"type":"equal","value":"length"}}]}}]}
|
|
@ -1 +0,0 @@
|
|||||||
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/error-assert-xpath</span></span></div><div class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span><span class="line section-header">[Asserts]</span><span class="line"><span class="query-type">xpath</span> <span class="string">"strong(//head/title)"</span> <span class="predicate-type">equals</span> <span class="string">"Welcome to Quiz!"</span></span></div></div></div>
|
|
@ -1 +0,0 @@
|
|||||||
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/error-assert-xpath"},"response":{"version":"HTTP/1.0","status":200,"asserts":[{"query":{"type":"xpath","expr":"strong(//head/title)"},"predicate":{"type":"equal","value":"Welcome to Quiz!"}}]}}]}
|
|
@ -1 +0,0 @@
|
|||||||
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">POST</span> <span class="url">unused</span></span></div><span class="line">{<span class="line"> "success": {{success}}</span><span class="line">}</span></span></div></div>
|
|
@ -1 +0,0 @@
|
|||||||
{"entries":[{"request":{"method":"POST","url":"unused","body":{"type":"json","value":{"success":"{{success}}"}}}}]}
|
|
@ -1 +0,0 @@
|
|||||||
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="url">http://10.0.0.0</span></span></div></div><span class="line"></span><span class="line"></span></div>
|
|
@ -1 +0,0 @@
|
|||||||
{"entries":[{"request":{"method":"GET","url":"http://10.0.0.0"}}]}
|
|
@ -1 +0,0 @@
|
|||||||
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">POST</span> <span class="url">http://localhost:8000/error-file-read-access</span></span></div><span class="line"><span>file,does_not_exist;</span></span><div class="response"><span class="line"></span><span class="line"><span class="version">HTTP/1.1</span> <span class="status">200</span></span></div></div></div>
|
|
@ -1 +0,0 @@
|
|||||||
{"entries":[{"request":{"method":"POST","url":"http://localhost:8000/error-file-read-access"},"response":{"version":"HTTP/1.1","status":200}}]}
|
|
@ -1 +0,0 @@
|
|||||||
{"entries":[{"request":{"method":"POST","url":"http://localhost:8000/error-file-read-access","body":{"type":"file","filename":"does_not_exist"}},"response":{"version":"HTTP/1.1","status":200}}]}
|
|
@ -1 +0,0 @@
|
|||||||
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="url">http://unknown</span></span></div></div><span class="line"></span></div>
|
|
@ -1 +0,0 @@
|
|||||||
{"entries":[{"request":{"method":"GET","url":"http://unknown"}}]}
|
|
@ -1 +0,0 @@
|
|||||||
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/error-invalid-jsonpath</span></span></div><div class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span><span class="line section-header">[Asserts]</span><span class="line"><span class="query-type">jsonpath</span> <span class="string">""</span> <span class="predicate-type">equals</span> <span class="boolean">false</span></span></div></div></div>
|
|
@ -1 +0,0 @@
|
|||||||
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/error-invalid-jsonpath"},"response":{"version":"HTTP/1.0","status":200,"asserts":[{"query":{"type":"jsonpath","expr":""},"predicate":{"type":"equal","value":false}}]}}]}
|
|
@ -1 +0,0 @@
|
|||||||
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="url">???</span></span></div></div><span class="line"></span></div>
|
|
@ -1 +0,0 @@
|
|||||||
{"entries":[{"request":{"method":"GET","url":"???"}}]}
|
|
@ -1 +0,0 @@
|
|||||||
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/error-invalid-xml</span></span></div><div class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span><span class="line section-header">[Asserts]</span><span class="line"><span class="query-type">xpath</span> <span class="string">"xx"</span> <span class="predicate-type">equals</span> <span class="number">1</span></span></div></div></div>
|
|
@ -1 +0,0 @@
|
|||||||
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/error-invalid-xml"},"response":{"version":"HTTP/1.0","status":200,"asserts":[{"query":{"type":"xpath","expr":"xx"},"predicate":{"type":"equal","value":1}}]}}]}
|
|
@ -1 +0,0 @@
|
|||||||
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/redirect/7</span></span></div><div class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span></div></div><span class="line"></span><span class="line"></span></div>
|
|
@ -1 +0,0 @@
|
|||||||
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/redirect/7"},"response":{"version":"HTTP/1.0","status":200}}]}
|
|
@ -1 +0,0 @@
|
|||||||
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">POST</span> <span class="url">http://localhost:8000/unused</span></span></div><span class="line section-header">[MultipartFormData]</span><span class="line"><span class="string">key1</span><span>:</span> <span class="string">value1</span></span><span class="line"><span class="string"><span class="string">upload1</span></span>: file,<span class="string">unknown</span>;</span></div><span class="line"></span><span class="line"></span><span class="line"></span><span class="line"></span></div>
|
|
@ -1 +0,0 @@
|
|||||||
{"entries":[{"request":{"method":"POST","url":"http://localhost:8000/unused","multipart_form_data":[{"name":"key1","value":"value1"},{"name":"upload1","filename":"unknown"}]}}]}
|
|
@ -1 +0,0 @@
|
|||||||
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/error-output-decompress</span></span></div><div class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span></div></div><span class="line"></span><span class="line"></span></div>
|
|
@ -1 +0,0 @@
|
|||||||
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/error-output-decompress"},"response":{"version":"HTTP/1.0","status":200}}]}
|
|
@ -1 +0,0 @@
|
|||||||
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/predicate/error/type</span></span></div><div class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span><span class="line section-header">[Asserts]</span><span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.status"</span> <span class="predicate-type">equals</span> <span class="string">"true"</span></span><span class="line"><span class="comment">#jsonpath "$.count" equals "0"</span></span><span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.count"</span> <span class="predicate-type">equals</span> <span class="number">0</span></span><span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.message"</span> <span class="predicate-type">equals</span> <span class="number">0</span></span><span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.empty"</span> <span class="predicate-type">equals</span> <span class="number">0</span></span><span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.number"</span> <span class="predicate-type">equals</span> <span class="number">1.1</span></span><span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.message"</span> <span class="predicate-type">startsWith</span> <span class="string">"hi"</span></span><span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.message"</span> <span class="predicate-type">endsWith</span> <span class="string">"hi"</span></span><span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.message"</span> <span class="predicate-type">contains</span> <span class="string">"hi"</span></span><span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.message"</span> <span class="predicate-type">matches</span> <span class="string">"hi"</span></span><span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.message"</span> <span class="query-type">count</span> <span class="predicate-type">==</span> <span class="number">1</span></span><span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.toto"</span> <span class="predicate-type">exists</span></span><span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.message"</span> not <span class="predicate-type">exists</span></span><span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.list"</span> <span class="query-type">count</span> <span class="predicate-type">==</span> <span class="number">2</span></span></div></div></div>
|
|
@ -1 +0,0 @@
|
|||||||
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/predicate/error/type"},"response":{"version":"HTTP/1.0","status":200,"asserts":[{"query":{"type":"jsonpath","expr":"$.status"},"predicate":{"type":"equal","value":"true"}},{"query":{"type":"jsonpath","expr":"$.count"},"predicate":{"type":"equal","value":0}},{"query":{"type":"jsonpath","expr":"$.message"},"predicate":{"type":"equal","value":0}},{"query":{"type":"jsonpath","expr":"$.empty"},"predicate":{"type":"equal","value":0}},{"query":{"type":"jsonpath","expr":"$.number"},"predicate":{"type":"equal","value":1.1}},{"query":{"type":"jsonpath","expr":"$.message"},"predicate":{"type":"start-with","value":"hi"}},{"query":{"type":"jsonpath","expr":"$.message"},"predicate":{"type":"end-with","value":"hi"}},{"query":{"type":"jsonpath","expr":"$.message"},"predicate":{"type":"contain","value":"hi"}},{"query":{"type":"jsonpath","expr":"$.message"},"predicate":{"type":"match","value":"hi"}},{"query":{"type":"jsonpath","expr":"$.message","subquery":{"type":"count"}},"predicate":{"type":"equal","value":1}},{"query":{"type":"jsonpath","expr":"$.toto"},"predicate":{"type":"exist"}},{"query":{"type":"jsonpath","expr":"$.message"},"predicate":{"not":true,"type":"exist"}},{"query":{"type":"jsonpath","expr":"$.list","subquery":{"type":"count"}},"predicate":{"type":"equal","value":2}}]}}]}
|
|
@ -1 +0,0 @@
|
|||||||
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/error-query-header-not-found</span></span></div><div class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span><span class="line"><span class="string">Custom</span><span>:</span> <span class="string">XXX</span></span></div></div><span class="line"></span></div>
|
|
@ -1 +0,0 @@
|
|||||||
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/error-query-header-not-found"},"response":{"version":"HTTP/1.0","status":200,"headers":[{"name":"Custom","value":"XXX"}]}}]}
|
|
@ -1 +0,0 @@
|
|||||||
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/error-query-invalid-json</span></span></div><div class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span><span class="line section-header">[Asserts]</span><span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.errors"</span> <span class="query-type">count</span> <span class="predicate-type">==</span> <span class="number">2</span></span></div></div><span class="line"></span></div>
|
|
@ -1 +0,0 @@
|
|||||||
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/error-query-invalid-json"},"response":{"version":"HTTP/1.0","status":200,"asserts":[{"query":{"type":"jsonpath","expr":"$.errors","subquery":{"type":"count"}},"predicate":{"type":"equal","value":2}}]}}]}
|
|
@ -1 +0,0 @@
|
|||||||
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/error-query-invalid-utf8</span></span></div><div class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span><span class="line section-header">[Asserts]</span><span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.errors"</span> <span class="query-type">count</span> <span class="predicate-type">==</span> <span class="number">2</span></span></div></div><span class="line"></span></div>
|
|
@ -1 +0,0 @@
|
|||||||
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/error-query-invalid-utf8"},"response":{"version":"HTTP/1.0","status":200,"asserts":[{"query":{"type":"jsonpath","expr":"$.errors","subquery":{"type":"count"}},"predicate":{"type":"equal","value":2}}]}}]}
|
|
@ -1 +0,0 @@
|
|||||||
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="url">{{url}}</span></span></div></div><span class="line"></span></div>
|
|
@ -1 +0,0 @@
|
|||||||
{"entries":[{"request":{"method":"GET","url":"{{url}}"}}]}
|
|
@ -1 +0,0 @@
|
|||||||
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/get-list</span></span></div><div class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span><span class="line section-header">[Captures]</span><span class="line">list<span>:</span> <span class="query-type">jsonpath</span> <span class="string">"$.values"</span></span></div></div><div class="hurl-entry"><div class="request"><span class="line"></span><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/undefined</span></span></div><span class="line section-header">[QueryStringParams]</span><span class="line"><span class="string">param1</span><span>:</span> <span class="string">{{list}}</span></span><div class="response"><span class="line"><span class="version">HTTP/1.1</span> <span class="status">200</span></span></div></div><span class="line"></span></div>
|
|
@ -1 +0,0 @@
|
|||||||
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/get-list"},"response":{"version":"HTTP/1.0","status":200,"captures":[{"name":"list","query":{"type":"jsonpath","expr":"$.values"}}]}},{"request":{"method":"GET","url":"http://localhost:8000/undefined","query_string_params":[{"name":"param1","value":"{{list}}"}]},"response":{"version":"HTTP/1.1","status":200}}]}
|
|
@ -1 +0,0 @@
|
|||||||
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/timeout</span></span></div></div><span class="line"></span><span class="line"></span></div>
|
|
@ -1 +0,0 @@
|
|||||||
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/timeout"}}]}
|
|
Loading…
Reference in New Issue
Block a user