コード例 #1
0
    def setUp(self):
        def pr1():
            pass

        def pr2():
            pass

        self.client = client_for(
            Service(processes=[
                Process(
                    pr1,
                    "pr1",
                    "Process 1",
                    abstract="Process 1",
                    keywords=["kw1a", "kw1b"],
                    metadata=[Metadata("pr1 metadata")],
                ),
                Process(
                    pr2,
                    "pr2",
                    "Process 2",
                    keywords=["kw2a"],
                    metadata=[Metadata("pr2 metadata")],
                ),
            ]))
コード例 #2
0
 def setUp(self):
     configuration.load_configuration()
     configuration.CONFIG.set('server', 'language', 'en-US,fr-CA')
     self.client = client_for(
         Service(processes=[
             Process(
                 lambda: None,
                 "pr1",
                 "Process 1",
                 abstract="Process 1",
                 translations={
                     "fr-CA": {
                         "title": "Processus 1",
                         "abstract": "Processus 1"
                     }
                 },
             ),
             Process(
                 lambda: None,
                 "pr2",
                 "Process 2",
                 abstract="Process 2",
                 translations={"fr-CA": {
                     "title": "Processus 2"
                 }},
             ),
         ]))
コード例 #3
0
    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'
コード例 #4
0
ファイル: test_capabilities.py プロジェクト: rbs-pli/pywps
    def setUp(self):
        def pr1():
            pass

        def pr2():
            pass

        self.client = client_for(
            Service(processes=[
                Process(pr1, 'pr1', 'Process 1'),
                Process(pr2, 'pr2', 'Process 2')
            ]))
コード例 #5
0
    def setUp(self):
        def pr1():
            pass

        def pr2():
            pass

        self.client = client_for(
            Service(processes=[
                Process(pr1,
                        'pr1',
                        'Process 1',
                        metadata=[Metadata('pr1 metadata')]),
                Process(pr2,
                        'pr2',
                        'Process 2',
                        metadata=[Metadata('pr2 metadata')])
            ]))
コード例 #6
0
ファイル: test_capabilities.py プロジェクト: janpisl/pywps
    def setUp(self):
        def pr1():
            pass

        def pr2():
            pass

        self.client = client_for(
            Service(processes=[
                Process(pr1,
                        'pr1',
                        'Process 1',
                        abstract='Process 1',
                        keywords=['kw1a', 'kw1b'],
                        metadata=[Metadata('pr1 metadata')]),
                Process(pr2,
                        'pr2',
                        'Process 2',
                        keywords=['kw2a'],
                        metadata=[Metadata('pr2 metadata')])
            ]))
コード例 #7
0
 def test_bad_request_type_with_post(self):
     client = client_for(Service())
     request_doc = WPS.Foo()
     resp = client.post_xml('', doc=request_doc)
     assert resp.status_code == 400
コード例 #8
0
 def test_bad_request_type_with_get(self):
     client = client_for(Service())
     resp = client.get('?Request=foo')
     assert resp.status_code == 400
コード例 #9
0
 def test_bad_http_verb(self):
     client = client_for(Service())
     resp = client.put('')
     assert resp.status_code == 405  # method not allowed
コード例 #10
0
ファイル: test_exceptions.py プロジェクト: rbs-pli/pywps-4
 def setUp(self):
     self.client = client_for(Service(processes=[]))