当前位置: 首页>>代码示例>>Python>>正文


Python common.client_for函数代码示例

本文整理汇总了Python中tests.common.client_for函数的典型用法代码示例。如果您正苦于以下问题:Python client_for函数的具体用法?Python client_for怎么用?Python client_for使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了client_for函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setUp

    def setUp(self):
        def pr1(): pass
        def pr2(): pass

        db.create_all()

        self.client = client_for(Service(processes=[Process(pr1, 'pr1', 'Process 1'), Process(pr2, 'pr2', 'Process 2')]))
开发者ID:jan-rudolf,项目名称:pywps,代码行数:7,代码来源:test_capabilities.py

示例2: test_bbox

    def test_bbox(self):
        if not PY2:
            self.skipTest('OWSlib not python 3 compatible')
        client = client_for(Service(processes=[create_bbox_process()]))
        request_doc = WPS.Execute(
            OWS.Identifier('my_bbox_process'),
            WPS.DataInputs(
                WPS.Input(
                    OWS.Identifier('mybbox'),
                    WPS.Data(WPS.BoundingBoxData(
                        OWS.LowerCorner('15 50'),
                        OWS.UpperCorner('16 51'),
                        ))
                )
            ),
            version='1.0.0'
        )

        resp = client.post_xml(doc=request_doc)

        assert_response_success(resp)

        [output] = xpath_ns(resp.xml, '/wps:ExecuteResponse'
                                   '/wps:ProcessOutputs/Output')
        self.assertEqual('outbbox', xpath_ns(output,
            './ows:Identifier')[0].text)
        self.assertEqual('15 50', xpath_ns(output,
            './ows:BoundingBox/ows:LowerCorner')[0].text)
开发者ID:jan-rudolf,项目名称:pywps,代码行数:28,代码来源:test_execute.py

示例3: setUp

    def setUp(self):
        db.create_all()

        def hello(request): pass
        def ping(request): pass
        processes = [Process(hello, 'hello', 'Process Hello'), Process(ping, 'ping', 'Process Ping')]
        self.client = client_for(Service(processes=processes))
开发者ID:jan-rudolf,项目名称:pywps,代码行数:7,代码来源:test_describe.py

示例4: test_assync

 def test_assync(self):
     client = client_for(Service(processes=[create_sleep()]))
     request_doc = WPS.Execute(
         OWS.Identifier('sleep'),
         WPS.DataInputs(
             WPS.Input(OWS.Identifier('seconds'), 120)))
     resp = client.post_xml(doc=request_doc)
     assert_response_accepted(resp) 
开发者ID:geoslegend,项目名称:pywps-4,代码行数:8,代码来源:test_assync.py

示例5: test_post_with_no_inputs

 def test_post_with_no_inputs(self):
     client = client_for(Service(processes=[create_ultimate_question()]))
     request_doc = WPS.Execute(
         OWS.Identifier('ultimate_question'),
         version='1.0.0'
     )
     resp = client.post_xml(doc=request_doc)
     assert_response_success(resp)
     assert get_output(resp.xml) == {'outvalue': '42'}
开发者ID:jan-rudolf,项目名称:pywps,代码行数:9,代码来源:test_execute.py

示例6: setUp

    def setUp(self):
        def hello(request):
            pass

        def ping(request):
            pass

        processes = [Process(hello, "hello", "Process Hello"), Process(ping, "ping", "Process Ping")]
        self.client = client_for(Service(processes=processes))
开发者ID:SiggyF,项目名称:pywps-4,代码行数:9,代码来源:test_describe.py

示例7: test_bad_service_type_with_get

    def test_bad_service_type_with_get(self):
        client = client_for(Service())
        resp = client.get('?service=foo')

        exception = resp.xpath('/ows:ExceptionReport'
                                '/ows:Exception')

        assert resp.status_code == 400
        assert exception[0].attrib['exceptionCode'] == 'InvalidParameterValue'
开发者ID:justb4,项目名称:pywps,代码行数:9,代码来源:test_capabilities.py

示例8: test_post_with_string_input

 def test_post_with_string_input(self):
     client = client_for(Service(processes=[create_greeter()]))
     request_doc = WPS.Execute(
         OWS.Identifier("greeter"),
         WPS.DataInputs(WPS.Input(OWS.Identifier("name"), WPS.Data(WPS.LiteralData("foo")))),
         version="1.0.0",
     )
     resp = client.post_xml(doc=request_doc)
     assert_response_success(resp)
     assert get_output(resp.xml) == {"message": "Hello foo!"}
开发者ID:khosrow,项目名称:pywps,代码行数:10,代码来源:test_execute.py

示例9: test_wcs

 def test_wcs(self):
     client = client_for(Service(processes=[create_sum_one()]))
     request_doc = WPS.Execute(
         OWS.Identifier('sum_one'),
         WPS.DataInputs(
             WPS.Input(
                 OWS.Identifier('input'),
                 WPS.Reference(href=wcsResource, mimeType='image/img'))),
         WPS.ProcessOutputs(
             WPS.Output(
                 OWS.Identifier('output'))))
     resp = client.post_xml(doc=request_doc)
     assert_response_success(resp)
开发者ID:uwer,项目名称:pywps-4,代码行数:13,代码来源:test_ows.py

示例10: test_post_with_string_input

 def test_post_with_string_input(self):
     client = client_for(Service(processes=[create_greeter()]))
     request_doc = WPS.Execute(
         OWS.Identifier('greeter'),
         WPS.DataInputs(
             WPS.Input(
                 OWS.Identifier('name'),
                 WPS.Data(WPS.LiteralData('foo'))
             )
         )
     )
     resp = client.post_xml(doc=request_doc)
     assert_response_success(resp)
     assert get_output(resp.xml) == {'message': "Hello foo!"}
开发者ID:lucacasagrande,项目名称:pywps-4,代码行数:14,代码来源:test_execute.py

示例11: test_wcs

 def test_wcs(self):
     try:
         sys.path.append("/usr/lib/grass64/etc/python/")
         import grass.script as grass
     except:
         self.skipTest("GRASS lib not found")
     client = client_for(Service(processes=[create_sum_one()]))
     request_doc = WPS.Execute(
         OWS.Identifier("sum_one"),
         WPS.DataInputs(WPS.Input(OWS.Identifier("input"), WPS.Reference(href=wcsResource, mimeType="image/img"))),
         WPS.ProcessOutputs(WPS.Output(OWS.Identifier("output"))),
         version="1.0.0",
     )
     resp = client.post_xml(doc=request_doc)
     assert_response_success(resp)
开发者ID:khosrow,项目名称:pywps,代码行数:15,代码来源:test_ows.py

示例12: test_wfs

 def test_wfs(self):
     client = client_for(Service(processes=[create_feature()]))
     request_doc = WPS.Execute(
         OWS.Identifier('feature'),
         WPS.DataInputs(
             WPS.Input(
                 OWS.Identifier('input'),
                 WPS.Reference(
                     {'{http://www.w3.org/1999/xlink}href': wfsResource},
                     mimeType='text/xml'))),
         WPS.ProcessOutputs(
             WPS.Output(
                 OWS.Identifier('output'))),
         version='1.0.0'
     )
     resp = client.post_xml(doc=request_doc)
     assert_response_success(resp)
开发者ID:geoslegend,项目名称:pywps-4,代码行数:17,代码来源:test_ows.py

示例13: test_wps_subset_countries

def test_wps_subset_countries():
    client = client_for(
        Service(processes=[SubsetcountryProcess()], cfgfiles=CFG_FILE))

    datainputs = datainputs_fmt.format(
        TESTDATA['cmip5_tasmax_2006_nc'],
        'CAN',
        "True")

    resp = client.get(
        service='wps', request='execute', version='1.0.0',
        identifier='subset_countries',
        datainputs=datainputs)

    assert_response_success(resp)

    # Check output file size is smaller than input.
    out = get_output(resp.xml)
    assert 'output' in out.keys()
开发者ID:bird-house,项目名称:flyingpigeon,代码行数:19,代码来源:test_wps_subset_countries.py

示例14: test_bbox

    def test_bbox(self):
        if not PY2:
            self.skipTest("OWSlib not python 3 compatible")
        client = client_for(Service(processes=[create_bbox_process()]))
        request_doc = WPS.Execute(
            OWS.Identifier("my_bbox_process"),
            WPS.DataInputs(
                WPS.Input(
                    OWS.Identifier("mybbox"),
                    WPS.Data(WPS.BoundingBoxData(OWS.LowerCorner("15 50"), OWS.UpperCorner("16 51"))),
                )
            ),
            version="1.0.0",
        )
        resp = client.post_xml(doc=request_doc)
        assert_response_success(resp)

        [output] = xpath_ns(resp.xml, "/wps:ExecuteResponse" "/wps:ProcessOutputs/Output")
        self.assertEqual("outbbox", xpath_ns(output, "./ows:Identifier")[0].text)
        self.assertEqual("15 50", xpath_ns(output, "./ows:BoundingBox/ows:LowerCorner")[0].text)
开发者ID:khosrow,项目名称:pywps,代码行数:20,代码来源:test_execute.py

示例15: test_wfs

    def test_wfs(self):
        client = client_for(Service(processes=[create_feature()]))
        request_doc = WPS.Execute(
            OWS.Identifier("feature"),
            WPS.DataInputs(
                WPS.Input(
                    OWS.Identifier("input"),
                    WPS.Reference(
                        {"{http://www.w3.org/1999/xlink}href": wfsResource},
                        mimeType=FORMATS.GML.mime_type,
                        encoding="",
                        schema="",
                    ),
                )
            ),
            WPS.ProcessOutputs(WPS.Output(OWS.Identifier("output"))),
            version="1.0.0",
        )
        resp = client.post_xml(doc=request_doc)

        assert_response_success(resp)
开发者ID:khosrow,项目名称:pywps,代码行数:21,代码来源:test_ows.py


注:本文中的tests.common.client_for函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。