mirror of
https://github.com/Orange-OpenSource/hurl.git
synced 2024-11-22 15:42:20 +03:00
Update test integ
This commit is contained in:
parent
59d32dc46d
commit
802d78359f
@ -1 +1 @@
|
||||
curl 'http://localhost:8000/variables' -H 'Name: Jennifer' -H 'Age: 30' -H 'Height: 1.7' -H 'Female: true' -H 'Id: 123' -H 'A_Null: null' -H 'Content-Type: application/json' --data $'{\n "name": "Jennifer",\n "age": 30,\n "height": 1.7,\n "female": true,\n "id": "123",\n "a_null": null\n}'
|
||||
curl 'http://localhost:8000/variables' -H 'Name: Jennifer' -H 'Age: 30' -H 'Height: 1.7' -H 'Female: true' -H 'Id: 123' -H 'A_Null: null' -H 'Country: Italy' -H 'Content-Type: application/json' --data $'{\n "name": "Jennifer",\n "age": 30,\n "height": 1.7,\n "female": true,\n "id": "123",\n "a_null": null,\n "country": "Italy"\n}'
|
||||
|
@ -1,17 +1,26 @@
|
||||
<pre><code class="language-hurl"><span class="hurl-entry"><span class="request"><span class="line"><span class="method">POST</span> <span class="url">http://localhost:8000/variables</span></span>
|
||||
<pre><code class="language-hurl"><span class="hurl-entry"><span class="request"><span class="line"></span><span class="comment"># Variables can be set from:</span>
|
||||
<span class="line"></span><span class="comment"># - an external properties file</span>
|
||||
<span class="line"></span><span class="comment"># - at the command-line with the --variable option</span>
|
||||
<span class="line"></span><span class="comment"># - in the Hurl File in the [Options] section</span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span class="method">POST</span> <span class="url">http://localhost:8000/variables</span></span>
|
||||
<span class="line"><span class="string">Name</span><span>:</span> <span class="string">{{name}}</span></span>
|
||||
<span class="line"><span class="string">Age</span><span>:</span> <span class="string">{{age}}</span></span>
|
||||
<span class="line"><span class="string">Height</span><span>:</span> <span class="string">{{height}}</span></span>
|
||||
<span class="line"><span class="string">Female</span><span>:</span> <span class="string">{{female}}</span></span>
|
||||
<span class="line"><span class="string">Id</span><span>:</span> <span class="string">{{my-id}}</span></span>
|
||||
<span class="line"><span class="string">A_Null</span><span>:</span> <span class="string">{{a_null}}</span></span>
|
||||
<span class="line"><span class="string">Country</span><span>:</span> <span class="string">{{country}}</span></span>
|
||||
<span class="line section-header">[Options]</span>
|
||||
<span class="line"><span class="string">variable</span><span>:</span> country<span>=</span>Italy</span>
|
||||
<span class="json"><span class="line">{</span>
|
||||
<span class="line"> "name": "{{name}}",</span>
|
||||
<span class="line"> "age": {{age}},</span>
|
||||
<span class="line"> "height": {{height}},</span>
|
||||
<span class="line"> "female": {{female}},</span>
|
||||
<span class="line"> "id": "{{my-id}}",</span>
|
||||
<span class="line"> "a_null": {{a_null}}</span>
|
||||
<span class="line"> "a_null": {{a_null}},</span>
|
||||
<span class="line"> "country": "{{country}}"</span>
|
||||
<span class="line">}</span></span>
|
||||
</span><span class="response"><span class="line"></span>
|
||||
<span class="line"><span class="version">HTTP/*</span> <span class="number">200</span></span>
|
||||
@ -22,4 +31,4 @@
|
||||
<span class="line"><span class="query-type">variable</span> <span class="string">"height"</span> <span class="predicate-type">==</span> <span class="number">1.70</span></span>
|
||||
<span class="line"><span class="query-type">variable</span> <span class="string">"a_null"</span> <span class="predicate-type">==</span> <span class="null">null</span></span>
|
||||
<span class="line"><span class="query-type">variable</span> <span class="string">"my-id"</span> <span class="predicate-type">==</span> <span class="string">"123"</span></span>
|
||||
</span></span></code></pre>
|
||||
<span class="line"><span class="query-type">variable</span> <span class="string">"country"</span> <span class="predicate-type">==</span> <span class="string">"Italy"</span></span></span></span></code></pre>
|
@ -1,3 +1,8 @@
|
||||
# Variables can be set from:
|
||||
# - an external properties file
|
||||
# - at the command-line with the --variable option
|
||||
# - in the Hurl File in the [Options] section
|
||||
|
||||
POST http://localhost:8000/variables
|
||||
Name: {{name}}
|
||||
Age: {{age}}
|
||||
@ -5,13 +10,17 @@ Height: {{height}}
|
||||
Female: {{female}}
|
||||
Id: {{my-id}}
|
||||
A_Null: {{a_null}}
|
||||
Country: {{country}}
|
||||
[Options]
|
||||
variable: country=Italy
|
||||
{
|
||||
"name": "{{name}}",
|
||||
"age": {{age}},
|
||||
"height": {{height}},
|
||||
"female": {{female}},
|
||||
"id": "{{my-id}}",
|
||||
"a_null": {{a_null}}
|
||||
"a_null": {{a_null}},
|
||||
"country": "{{country}}"
|
||||
}
|
||||
|
||||
HTTP/* 200
|
||||
@ -22,3 +31,4 @@ variable "age" == 30
|
||||
variable "height" == 1.70
|
||||
variable "a_null" == null
|
||||
variable "my-id" == "123"
|
||||
variable "country" == "Italy"
|
@ -1 +1 @@
|
||||
{"entries":[{"request":{"method":"POST","url":"http://localhost:8000/variables","headers":[{"name":"Name","value":"{{name}}"},{"name":"Age","value":"{{age}}"},{"name":"Height","value":"{{height}}"},{"name":"Female","value":"{{female}}"},{"name":"Id","value":"{{my-id}}"},{"name":"A_Null","value":"{{a_null}}"}],"body":{"type":"json","value":{"name":"{{name}}","age":"{{age}}","height":"{{height}}","female":"{{female}}","id":"{{my-id}}","a_null":"{{a_null}}"}}},"response":{"status":200,"asserts":[{"query":{"type":"variable","name":"name"},"predicate":{"type":"equal","value":"Jennifer"}},{"query":{"type":"variable","name":"female"},"predicate":{"type":"equal","value":true}},{"query":{"type":"variable","name":"age"},"predicate":{"type":"equal","value":30}},{"query":{"type":"variable","name":"height"},"predicate":{"type":"equal","value":1.70}},{"query":{"type":"variable","name":"a_null"},"predicate":{"type":"equal","value":null}},{"query":{"type":"variable","name":"my-id"},"predicate":{"type":"equal","value":"123"}}]}}]}
|
||||
{"entries":[{"request":{"method":"POST","url":"http://localhost:8000/variables","headers":[{"name":"Name","value":"{{name}}"},{"name":"Age","value":"{{age}}"},{"name":"Height","value":"{{height}}"},{"name":"Female","value":"{{female}}"},{"name":"Id","value":"{{my-id}}"},{"name":"A_Null","value":"{{a_null}}"},{"name":"Country","value":"{{country}}"}],"body":{"type":"json","value":{"name":"{{name}}","age":"{{age}}","height":"{{height}}","female":"{{female}}","id":"{{my-id}}","a_null":"{{a_null}}","country":"{{country}}"}}},"response":{"status":200,"asserts":[{"query":{"type":"variable","name":"name"},"predicate":{"type":"equal","value":"Jennifer"}},{"query":{"type":"variable","name":"female"},"predicate":{"type":"equal","value":true}},{"query":{"type":"variable","name":"age"},"predicate":{"type":"equal","value":30}},{"query":{"type":"variable","name":"height"},"predicate":{"type":"equal","value":1.70}},{"query":{"type":"variable","name":"a_null"},"predicate":{"type":"equal","value":null}},{"query":{"type":"variable","name":"my-id"},"predicate":{"type":"equal","value":"123"}},{"query":{"type":"variable","name":"country"},"predicate":{"type":"equal","value":"Italy"}}]}}]}
|
@ -12,6 +12,7 @@ def variables():
|
||||
assert request.headers["Id"] == "123"
|
||||
assert request.headers["Height"] == "1.7"
|
||||
assert request.headers["A_null"] == "null"
|
||||
assert request.headers["Country"] == "Italy"
|
||||
|
||||
s = request.data.decode("utf-8")
|
||||
data = json.loads(s)
|
||||
@ -21,4 +22,5 @@ def variables():
|
||||
assert data["id"] == "123"
|
||||
assert data["height"] == 1.7
|
||||
assert data["a_null"] is None
|
||||
assert data["country"] == "Italy"
|
||||
return ""
|
||||
|
Loading…
Reference in New Issue
Block a user