blob: 19c3f9ccd76136f7fe11dda636b16d4cf5c119b0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# Implementation of scenario steps
## Server aliases
IMPLEMENTS GIVEN server is also known as (\S+)
import yarnhelper
h = yarnhelper.YarnHelper()
h.set_variable('SERVER', h.get_next_match())
## HTTP requests
IMPLEMENTS WHEN user fetches (\S+)
import yarnhelper
h = yarnhelper.YarnHelper()
server = h.get_variable('SERVER')
url = h.get_next_match()
status, body = h.http_get(server, url)
h.set_variable('http_status', status)
h.set_variable('http_body', body)
IMPLEMENTS THEN HTTP status is (\d+)
import yarnhelper
h = yarnhelper.YarnHelper()
expected = h.get_variable('http_status')
actual = int(h.get_next_match())
h.assertEqual(expected, actual)
IMPLEMENTS THEN HTTP body matches "(.*)"
pass
|