-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathtest_wps_show_defaults.py
50 lines (44 loc) · 1.4 KB
/
test_wps_show_defaults.py
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import json
from pywps import Service
from pywps import get_ElementMakerForVersion
from .common import client_for
from emu.processes.wps_show_defaults import ShowDefaults
VERSION = "1.0.0"
WPS, OWS = get_ElementMakerForVersion(VERSION)
def test_wps_show_defaults_post():
client = client_for(Service(processes=[ShowDefaults()]))
request_doc = WPS.Execute(
OWS.Identifier('show_defaults'),
WPS.DataInputs(
WPS.Input(
OWS.Identifier('string_0'),
WPS.Data(WPS.LiteralData("ZERO"))
),
# WPS.Input(
# OWS.Identifier('string_1'),
# WPS.Data(WPS.LiteralData("ONE"))
# ),
# WPS.Input(
# OWS.Identifier('string_2'),
# WPS.Data(WPS.LiteralData("TWO"))
# ),
WPS.Input(
OWS.Identifier('string_3'),
WPS.Data(WPS.LiteralData("THREE"))
)
),
WPS.ResponseForm(
WPS.RawDataOutput(
OWS.Identifier('output')
)
),
version='1.0.0'
)
resp = client.post_xml(doc=request_doc)
print(resp.data)
assert resp.status_code == 200
result = json.loads(resp.data)
assert result['string0'] == 'ZERO'
assert result['string1'] == 'one'
assert result['string2'] == 'two'
assert result['string3'] == 'THREE'