mirror of
https://github.com/Orange-OpenSource/hurl.git
synced 2024-11-23 20:12:09 +03:00
Add non-renderable variables
This commit is contained in:
parent
25fff31be1
commit
947603af12
@ -1,7 +1,21 @@
|
||||
error: Unrenderable variable
|
||||
--> tests_failed/template_variable_not_renderable.hurl:10:11
|
||||
--> tests_failed/template_variable_not_renderable.hurl:12:9
|
||||
|
|
||||
10 | param1: {{list}}
|
||||
12 | list: {{list}}
|
||||
| ^^^^ variable <list> with value [1,2,3] can not be rendered
|
||||
|
|
||||
|
||||
error: Unrenderable variable
|
||||
--> tests_failed/template_variable_not_renderable.hurl:17:11
|
||||
|
|
||||
17 | object: {{object}}
|
||||
| ^^^^^^ variable <object> with value Object() can not be rendered
|
||||
|
|
||||
|
||||
error: Unrenderable variable
|
||||
--> tests_failed/template_variable_not_renderable.hurl:22:12
|
||||
|
|
||||
22 | nodeset: {{nodeset}}
|
||||
| ^^^^^^^ variable <nodeset> with value Nodeset1 can not be rendered
|
||||
|
|
||||
|
||||
|
@ -1,12 +1,23 @@
|
||||
# Only variables with scalar value (string, integer, ...) can be rendered in template
|
||||
GET http://localhost:8000/get-list
|
||||
GET http://localhost:8000/get-variables-not-renderable
|
||||
|
||||
HTTP 200
|
||||
[Captures]
|
||||
list: jsonpath "$.values"
|
||||
list: jsonpath "$.list"
|
||||
object: jsonpath "$.object"
|
||||
nodeset: jsonpath "$.nodeset" xpath "/"
|
||||
|
||||
GET http://localhost:8000/undefined
|
||||
[QueryStringParams]
|
||||
param1: {{list}}
|
||||
list: {{list}}
|
||||
HTTP 200
|
||||
|
||||
GET http://localhost:8000/undefined
|
||||
[QueryStringParams]
|
||||
object: {{object}}
|
||||
HTTP 200
|
||||
|
||||
GET http://localhost:8000/undefined
|
||||
[QueryStringParams]
|
||||
nodeset: {{nodeset}}
|
||||
HTTP 200
|
||||
|
@ -1,3 +1,3 @@
|
||||
Set-StrictMode -Version latest
|
||||
$ErrorActionPreference = 'Stop'
|
||||
hurl tests_failed/template_variable_not_renderable.hurl
|
||||
hurl tests_failed/template_variable_not_renderable.hurl --continue-on-error
|
||||
|
@ -1,6 +1,6 @@
|
||||
from app import app
|
||||
|
||||
|
||||
@app.route("/get-list")
|
||||
def get_list():
|
||||
return '{"values":[1,2,3]}'
|
||||
@app.route("/get-variables-not-renderable")
|
||||
def get_variables_not_renderable():
|
||||
return '{"list":[1,2,3], "object":{"id":1}, "nodeset": "<node></node>"}'
|
||||
|
@ -1,3 +1,3 @@
|
||||
#!/bin/bash
|
||||
set -Eeuo pipefail
|
||||
hurl tests_failed/template_variable_not_renderable.hurl
|
||||
hurl tests_failed/template_variable_not_renderable.hurl --continue-on-error
|
||||
|
Loading…
Reference in New Issue
Block a user