Skip to content

Commit

Permalink
Add integration test for --max-filesize
Browse files Browse the repository at this point in the history
  • Loading branch information
jcamiel committed Apr 1, 2024
1 parent bb0008b commit 0aef995
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 2 deletions.
7 changes: 7 additions & 0 deletions integration/hurl/tests_failed/max_filesize.err
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
error: HTTP connection
--> tests_failed/max_filesize.hurl:1:5
|
1 | GET http://localhost:8000/max-filesize-fail
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (63) Maximum file size exceeded
|

2 changes: 2 additions & 0 deletions integration/hurl/tests_failed/max_filesize.exit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
3

2 changes: 2 additions & 0 deletions integration/hurl/tests_failed/max_filesize.hurl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
GET http://localhost:8000/max-filesize-fail
HTTP 200
3 changes: 3 additions & 0 deletions integration/hurl/tests_failed/max_filesize.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Set-StrictMode -Version latest
$ErrorActionPreference = 'Stop'
hurl --max-filesize 255 tests_failed/max_filesize.hurl
8 changes: 8 additions & 0 deletions integration/hurl/tests_failed/max_filesize.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from app import app
from flask import Response


@app.route("/max-filesize-fail")
def max_filesize_fail():
data = b"x" * 256
return Response(data, mimetype="application/octet-stream")
3 changes: 3 additions & 0 deletions integration/hurl/tests_failed/max_filesize.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
set -Eeuo pipefail
hurl --max-filesize 255 tests_failed/max_filesize.hurl
2 changes: 1 addition & 1 deletion integration/hurl/tests_failed/max_redirect.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Set-StrictMode -Version latest
$ErrorActionPreference = 'Stop'
hurl tests_failed/max_redirect.hurl --location --max-redirs 5
hurl --location --max-redirs 5 tests_failed/max_redirect.hurl
2 changes: 1 addition & 1 deletion integration/hurl/tests_failed/max_redirect.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
set -Eeuo pipefail
hurl tests_failed/max_redirect.hurl --location --max-redirs 5
hurl --location --max-redirs 5 tests_failed/max_redirect.hurl

0 comments on commit 0aef995

Please sign in to comment.