-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathtest_wps_caps.py
51 lines (46 loc) · 1.41 KB
/
test_wps_caps.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
51
# -*- encoding: utf-8 -*-
from pywps import Service
from .common import client_for
from emu.processes import processes
def test_wps_caps():
client = client_for(Service(processes=processes))
resp = client.get(service='wps', request='getcapabilities', version='1.0.0', language='en-US')
names = resp.xpath_text('/wps:Capabilities'
'/wps:ProcessOfferings'
'/wps:Process'
'/ows:Identifier')
assert sorted(names.split()) == [
'bbox',
'binaryoperatorfornumbers',
'chomsky',
'dummyprocess',
'esgf_demo',
'geodata',
'hello',
'inout',
'multiple_outputs',
'nap',
'ncmeta',
'ncml',
'non.py-id',
'output_formats',
'pandas',
'poly_centroid',
'show_defaults',
'show_error',
'simple_dry_run',
'sleep',
'translation',
'ultimate_question',
'wordcounter',
]
# caps language
assert resp.xpath('/wps:Capabilities/@xml:lang')[0] == "en-US"
# supported languages
languages = resp.xpath_text('/wps:Capabilities'
'/wps:Languages'
'/wps:Supported'
'/ows:Language')
assert 'en-US' in languages
assert 'fr-CA' in languages
assert 'de-DE' in languages