-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathtest_wps_translation.py
50 lines (42 loc) · 1.48 KB
/
test_wps_translation.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
from pywps import Service
from pywps.tests import assert_response_success
from .common import client_for
from emu.processes.wps_translation import Translation
def test_wps_translation_describe_fr():
client = client_for(Service(processes=[Translation()]))
resp = client.get(
service='wps', request='DescribeProcess', version='1.0.0',
identifier='translation',
language="fr-CA")
print(resp.data)
title = resp.xpath_text(
'/wps:ProcessDescriptions'
'/ProcessDescription'
'/ows:Title'
)
assert title == 'Processus traduit'
def test_wps_translation_describe_de():
client = client_for(Service(processes=[Translation()]))
resp = client.get(
service='wps', request='DescribeProcess', version='1.0.0',
identifier='translation',
language="de-DE")
print(resp.data)
title = resp.xpath_text(
'/wps:ProcessDescriptions'
'/ProcessDescription'
'/ows:Title'
)
assert title == 'Mehrsprachiger Prozess'
def test_wps_translation_execute():
client = client_for(Service(processes=[Translation()]))
datainputs = "input1=10"
resp = client.get(
service='wps', request='execute', version='1.0.0',
identifier='translation',
datainputs=datainputs,
language="fr-CA")
print(resp.data)
assert_response_success(resp)
outputs = list(resp.xpath('/wps:ExecuteResponse/wps:ProcessOutputs/wps:Output')[0])
assert outputs[1].text == "Sortie #1"