-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathtest_wps_wordcounter.py
34 lines (28 loc) · 1.05 KB
/
test_wps_wordcounter.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
import pytest
import json
from pywps import Service
from pywps.tests import assert_response_success
from .common import client_for, resource_file
from emu.processes.wps_wordcounter import WordCounter
def test_wps_wordcount_file():
client = client_for(Service(processes=[WordCounter()]))
datainputs = "text=@xlink:href=file://{0}".format(
resource_file('alice-in-wonderland.txt'))
resp = client.get(
service='wps', request='execute', version='1.0.0',
identifier='wordcounter',
datainputs=datainputs)
assert_response_success(resp)
@pytest.mark.online
def test_wps_wordcount_href():
client = client_for(Service(processes=[WordCounter()]))
datainputs = "text=@xlink:href={0}".format(
"https://en.wikipedia.org/wiki/Web_Processing_Service")
resp = client.get(
service='wps', request='execute', version='1.0.0',
identifier='wordcounter',
datainputs=datainputs,
rawdataoutput='output=@mimetype=application/json'
)
assert resp.status_code == 200
json.loads(resp.data)