mirror of
https://github.com/Orange-OpenSource/hurl.git
synced 2024-12-18 16:11:34 +03:00
6b7753e174
If HTTP version or status are not correct, we fail the test without running others asserts.
17 lines
1.7 KiB
HTML
17 lines
1.7 KiB
HTML
<pre><code class="language-hurl"><span class="hurl-entry"><span class="request"><span class="line"></span><span class="comment"># We add various explicit asserts on the body, and</span>
|
|
<span class="line"></span><span class="comment"># implicit asserts on the response headers.</span>
|
|
<span class="line"></span><span class="comment"># As the status code is not correct, those asserts</span>
|
|
<span class="line"></span><span class="comment"># should not be tested (the status code is a "stronger"</span>
|
|
<span class="line"></span><span class="comment"># assert than the others).</span>
|
|
<span class="line"></span>
|
|
<span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/not_found</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 class="line"><span class="string">x-baz</span><span>:</span> <span class="string">xxx</span></span>
|
|
<span class="line section-header">[Asserts]</span>
|
|
<span class="line"><span class="query-type">duration</span> <span class="predicate-type"><</span> <span class="number">0</span></span>
|
|
<span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.foo"</span> <span class="predicate-type">startsWith</span> <span class="string">"something"</span></span>
|
|
<span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.bar"</span> <span class="not">not</span> <span class="predicate-type">exists</span></span>
|
|
<span class="line"><span class="query-type">header</span> <span class="string">"x-bar"</span> <span class="predicate-type">exists</span></span>
|
|
</span></span></code></pre>
|