File: test_wps_request11_bbox.py

package info (click to toggle)
owslib 0.23.0-1%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 11,176 kB
  • sloc: xml: 137,886; python: 20,041; makefile: 167; sh: 11
file content (22 lines) | stat: -rw-r--r-- 839 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Test generation of a WPS request from input arguments.
# The specific request involves a "bbox" process submitted to the Emu WPS service
# (https://github.com/bird-house/emu).

from tests.utils import resource_file, compare_xml
from owslib.wps import WebProcessingService, WPSExecution, BoundingBoxDataInput
from owslib.etree import etree


def test_wps_request11_bbox():
    processid = "bbox"
    bbox = BoundingBoxDataInput([51.9, 7.0, 53.0, 8.0])
    inputs = [("bbox", bbox)]

    # Build XML request for WPS process execution
    execution = WPSExecution()
    requestElement = execution.buildRequest(processid, inputs)
    request = etree.tostring(requestElement)

    # Compare to cached XML request
    _request = open(resource_file('wps_EmuExecuteRequest11.xml'), 'rb').read()
    assert compare_xml(request, _request) is True