• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python common.client_for函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: 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)
        from lxml import etree

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


示例17: test_get_with_no_inputs

    def test_get_with_no_inputs(self):
        client = client_for(Service(processes=[create_ultimate_question()]))
        resp = client.get("?service=wps&version=1.0.0&Request=Execute&identifier=ultimate_question")
        assert_response_success(resp)

        assert get_output(resp.xml) == {"outvalue": "42"}
开发者ID:khosrow,项目名称:pywps,代码行数:6,代码来源:test_execute.py


示例18: test_get_with_no_inputs

 def test_get_with_no_inputs(self):
     client = client_for(Service(processes=[create_ultimate_question()]))
     resp = client.get('?Request=Execute&identifier=ultimate_question')
     assert_response_success(resp)
     assert get_output(resp.xml) == {'outvalue': '42'}
开发者ID:lucacasagrande,项目名称:pywps-4,代码行数:5,代码来源:test_execute.py


示例19: test_missing_process_error

 def test_missing_process_error(self):
     client = client_for(Service(processes=[create_ultimate_question()]))
     resp = client.get('?Request=Execute&identifier=foo')
     assert resp.status_code == 400
开发者ID:lucacasagrande,项目名称:pywps-4,代码行数:4,代码来源:test_execute.py


示例20: setUp

 def setUp(self):
     self.client = client_for(Service(processes=[]))
开发者ID:inowas,项目名称:pywps,代码行数:2,代码来源:test_exceptions.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python common.fire_mqtt_message函数代码示例发布时间:2022-05-27
下一篇:
Python common.async_mock_service函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap