Skip to content

Commit

Permalink
Add integration test with localized HTTP reason phrase.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcamiel authored and hurl-bot committed Apr 18, 2024
1 parent 58840f2 commit 01a2603
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions integration/hurl/tests_ok/reason.curl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
curl 'http://localhost:8000/reason-french'
27 changes: 27 additions & 0 deletions integration/hurl/tests_ok/reason.err.pattern
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
* ------------------------------------------------------------------------------
* Executing entry 1
*
* Cookie store:
*
* Request:
* GET http://localhost:8000/reason-french
*
* Request can be run with the following curl command:
* curl 'http://localhost:8000/reason-french'
*
> GET /reason-french HTTP/1.1
> Host: localhost:8000
> Accept: */*
> User-Agent: hurl/~~~
>
* Response: (received 7 bytes in ~~~ ms)
*
< HTTP/1.1 200 Succès
< Server: Werkzeug/~~~ Python/~~~
< Date: ~~~
< Content-Type: text/html; charset=utf-8
< Content-Length: 7
< Server: Flask Server
< Connection: close
<
*
4 changes: 4 additions & 0 deletions integration/hurl/tests_ok/reason.hurl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This file tests an HTTP endpoint that returns a localized HTTP reason phrase.
# Some HTTP clients doesn't like it, curl does not care.
GET http://localhost:8000/reason-french
HTTP 200
1 change: 1 addition & 0 deletions integration/hurl/tests_ok/reason.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Bonjour
3 changes: 3 additions & 0 deletions integration/hurl/tests_ok/reason.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Set-StrictMode -Version latest
$ErrorActionPreference = 'Stop'
hurl --verbose tests_ok/reason.hurl
6 changes: 6 additions & 0 deletions integration/hurl/tests_ok/reason.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from app import app


@app.route("/reason-french")
def reason_french():
return "Bonjour", "200 Succès"
3 changes: 3 additions & 0 deletions integration/hurl/tests_ok/reason.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
set -Eeuo pipefail
hurl --verbose tests_ok/reason.hurl

0 comments on commit 01a2603

Please sign in to comment.