Example #1
0
 def test_one_string(self):
     request_doc = WPS.Execute(
         OWS.Identifier('foo'),
         WPS.DataInputs(
             WPS.Input(OWS.Identifier('name'),
                       WPS.Data(WPS.LiteralData('foo')))))
     assert get_input_from_xml(request_doc).to_dict() == {'name': 'foo'}
Example #2
0
 def test_one_string(self):
     request_doc = WPS.Execute(
         OWS.Identifier('foo'),
         WPS.DataInputs(
             WPS.Input(
                 OWS.Identifier('name'),
                 WPS.Data(WPS.LiteralData('foo')))))
     assert get_input_from_xml(request_doc).to_dict() == {'name': 'foo'}
Example #3
0
 def test_two_strings(self):
     request_doc = WPS.Execute(
         OWS.Identifier('foo'),
         WPS.DataInputs(
             WPS.Input(OWS.Identifier('name'),
                       WPS.Data(WPS.LiteralData('foo'))),
             WPS.Input(OWS.Identifier('name'),
                       WPS.Data(WPS.LiteralData('bar')))))
     rv = get_input_from_xml(request_doc)
     assert rv.getlist('name') == ['foo', 'bar']
Example #4
0
 def test_two_strings(self):
     request_doc = WPS.Execute(
         OWS.Identifier('foo'),
         WPS.DataInputs(
             WPS.Input(
                 OWS.Identifier('name'),
                 WPS.Data(WPS.LiteralData('foo'))),
             WPS.Input(
                 OWS.Identifier('name'),
                 WPS.Data(WPS.LiteralData('bar')))))
     rv = get_input_from_xml(request_doc)
     assert rv.getlist('name') == ['foo', 'bar']
Example #5
0
 def test_complex_input(self):
     the_data = E.TheData("hello world")
     request_doc = WPS.Execute(
         OWS.Identifier('foo'),
         WPS.DataInputs(
             WPS.Input(
                 OWS.Identifier('name'),
                 WPS.Data(WPS.ComplexData(the_data,
                                          mimeType='text/foobar')))))
     rv = get_input_from_xml(request_doc)
     assert rv['name'].mime_type == 'text/foobar'
     rv_doc = lxml.etree.parse(rv['name']).getroot()
     assert rv_doc.tag == 'TheData'
     assert rv_doc.text == "hello world"
Example #6
0
 def test_complex_input(self):
     the_data = E.TheData("hello world")
     request_doc = WPS.Execute(
         OWS.Identifier('foo'),
         WPS.DataInputs(
             WPS.Input(
                 OWS.Identifier('name'),
                 WPS.Data(
                     WPS.ComplexData(the_data, mimeType='text/foobar')))))
     rv = get_input_from_xml(request_doc)
     assert rv['name'].mime_type == 'text/foobar'
     rv_doc = lxml.etree.parse(rv['name']).getroot()
     assert rv_doc.tag == 'TheData'
     assert rv_doc.text == "hello world"
Example #7
0
 def test_empty(self):
     request_doc = WPS.Execute(OWS.Identifier('foo'))
     assert get_input_from_xml(request_doc) == {}
Example #8
0
 def test_empty(self):
     request_doc = WPS.Execute(OWS.Identifier('foo'))
     assert get_input_from_xml(request_doc) == {}