mirror of
https://github.com/Orange-OpenSource/hurl.git
synced 2024-11-26 00:22:10 +03:00
Harden bom integration test.
This commit is contained in:
parent
3dcaa675bb
commit
74cce8b994
@ -1,2 +1,2 @@
|
||||
curl 'http://localhost:8000/utf8_bom'
|
||||
|
||||
curl 'http://localhost:8000/mirror' -H 'Content-Type:' --data '@tests_ok/bom.hurl'
|
||||
|
@ -1,6 +1,16 @@
|
||||
<pre><code class="language-hurl"><span class="hurl-entry"><span class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/utf8_bom</span></span>
|
||||
<pre><code class="language-hurl"><span class="hurl-entry"><span class="request"><span class="line"></span><span class="comment"># This Hurl file begins with a BOM marker.</span>
|
||||
<span class="line"></span><span class="comment"># You can check it with 'hexdump -c bom.hurl'</span>
|
||||
<span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/utf8_bom</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="multiline"><span class="line">```Hello World!```</span></span>
|
||||
</span></span><span class="line"></span>
|
||||
</code></pre>
|
||||
</span></span><span class="hurl-entry"><span class="request"><span class="line"></span>
|
||||
<span class="line"></span><span class="comment"># We send the content of this file and get back the same</span>
|
||||
<span class="line"></span><span class="comment"># bytes from /mirror to test the presence of the BOM marker.</span>
|
||||
<span class="line"><span class="method">POST</span> <span class="url">http://localhost:8000/mirror</span></span>
|
||||
<span class="line">file,<span class="filename">bom.hurl</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 section-header">[Asserts]</span>
|
||||
<span class="line"><span class="query-type">bytes</span> <span class="predicate-type">startsWith</span> hex,<span class="hex">efbbbf</span>;</span>
|
||||
</span></span></code></pre>
|
||||
|
@ -1,5 +1,15 @@
|
||||
GET http://localhost:8000/utf8_bom
|
||||
# This Hurl file begins with a BOM marker.
|
||||
# You can check it with 'hexdump -c bom.hurl'
|
||||
GET http://localhost:8000/utf8_bom
|
||||
|
||||
HTTP 200
|
||||
```Hello World!```
|
||||
|
||||
# We send the content of this file and get back the same
|
||||
# bytes from /mirror to test the presence of the BOM marker.
|
||||
POST http://localhost:8000/mirror
|
||||
file,bom.hurl;
|
||||
|
||||
HTTP 200
|
||||
[Asserts]
|
||||
bytes startsWith hex,efbbbf;
|
||||
|
@ -1 +1 @@
|
||||
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/utf8_bom"},"response":{"status":200,"body":{"type":"text","value":"Hello World!"}}}]}
|
||||
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/utf8_bom"},"response":{"status":200,"body":{"type":"text","value":"Hello World!"}}},{"request":{"method":"POST","url":"http://localhost:8000/mirror","body":{"type":"file","filename":"bom.hurl"}},"response":{"status":200,"asserts":[{"query":{"type":"bytes"},"predicate":{"type":"start-with","value":"77u/","encoding":"base64"}}]}}]}
|
||||
|
@ -5,3 +5,8 @@ from flask import request
|
||||
@app.route("/utf8_bom")
|
||||
def utf8_bom():
|
||||
return "Hello World!"
|
||||
|
||||
|
||||
@app.route("/mirror", methods=["POST"])
|
||||
def mirror():
|
||||
return request.data
|
||||
|
2
integration/tests_ok/bom.windows.curl
Normal file
2
integration/tests_ok/bom.windows.curl
Normal file
@ -0,0 +1,2 @@
|
||||
curl 'http://localhost:8000/utf8_bom'
|
||||
curl 'http://localhost:8000/mirror' -H 'Content-Type:' --data '@tests_ok\bom.hurl'
|
Loading…
Reference in New Issue
Block a user