Add test failed multiline

This commit is contained in:
Fabrice Reix 2024-04-19 15:23:13 +02:00 committed by hurl-bot
parent 48c6c26d42
commit cc799fdf3c
No known key found for this signature in database
GPG Key ID: 1283A2B4A0DCAF8D
10 changed files with 158 additions and 0 deletions

View File

@ -0,0 +1,37 @@
error: Assert body value
--> tests_failed/multiline.hurl:4:1
|
| GET http://localhost:8000/error/multiline
| ...
4 | {
| ^ actual value is <{
| "first_name": "John",
| "last_name": "Smith",
| "is_alive": true,
| "age": 28,
| "address": {
| "street_address": "21 2nd Street",
| "city": "New York",
| "state": "NY",
| "postal_code": "10021-3100"
| },
| "phone_numbers": [
| {
| "type": "home",
| "number": "212 555-1234"
| },
| {
| "type": "office",
| "number": "646 555-4567"
| }
| ],
| "children": [
| "Catherine",
| "Thomas",
| "Trevor"
| ],
| "spouse": null
| }
| >
|

View File

@ -0,0 +1,2 @@
4

View File

@ -0,0 +1,34 @@
GET http://localhost:8000/error/multiline
HTTP 200
```
{
"first_name": "John",
"last_name": "Smith",
"is_alive": true,
"age": 27,
"address": {
"street_address": "21 2nd Street",
"city": "New York",
"state": "NY",
"postal_code": "10021-3100"
},
"phone_numbers": [
{
"type": "home",
"number": "212 555-1234"
},
{
"type": "office",
"number": "646 555-4567"
}
],
"children": [
"Catherine",
"Thomas",
"Trevor"
],
"spouse": null
}
```

View File

@ -0,0 +1,3 @@
Set-StrictMode -Version latest
$ErrorActionPreference = 'Stop'
hurl --no-color tests_failed/multiline.hurl

View File

@ -0,0 +1,34 @@
from app import app
@app.route("/error/multiline")
def error_multiline():
return """{
"first_name": "John",
"last_name": "Smith",
"is_alive": true,
"age": 28,
"address": {
"street_address": "21 2nd Street",
"city": "New York",
"state": "NY",
"postal_code": "10021-3100"
},
"phone_numbers": [
{
"type": "home",
"number": "212 555-1234"
},
{
"type": "office",
"number": "646 555-4567"
}
],
"children": [
"Catherine",
"Thomas",
"Trevor"
],
"spouse": null
}
"""

View File

@ -0,0 +1,3 @@
#!/bin/bash
set -Eeuo pipefail
hurl --no-color tests_failed/multiline.hurl

View File

@ -0,0 +1,37 @@
error: Assert body value
--> tests_failed/multiline.hurl:4:1
 |
 | GET http://localhost:8000/error/multiline
 | ...
 4 | {
 | ^ actual value is <{
 |  "first_name": "John",
 |  "last_name": "Smith",
 |  "is_alive": true,
 |  "age": 28,
 |  "address": {
 |  "street_address": "21 2nd Street",
 |  "city": "New York",
 |  "state": "NY",
 |  "postal_code": "10021-3100"
 |  },
 |  "phone_numbers": [
 |  {
 |  "type": "home",
 |  "number": "212 555-1234"
 |  },
 |  {
 |  "type": "office",
 |  "number": "646 555-4567"
 |  }
 |  ],
 |  "children": [
 |  "Catherine",
 |  "Thomas",
 |  "Trevor"
 |  ],
 |  "spouse": null
 | }
 | >
 |

View File

@ -0,0 +1,2 @@
4

View File

@ -0,0 +1,3 @@
Set-StrictMode -Version latest
$ErrorActionPreference = 'Stop'
hurl --color tests_failed/multiline.hurl

View File

@ -0,0 +1,3 @@
#!/bin/bash
set -Eeuo pipefail
hurl --color tests_failed/multiline.hurl