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")], ), ]))
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" }}, ), ]))
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'
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') ]))
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')]) ]))
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')]) ]))
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
def test_bad_request_type_with_get(self): client = client_for(Service()) resp = client.get('?Request=foo') assert resp.status_code == 400
def test_bad_http_verb(self): client = client_for(Service()) resp = client.put('') assert resp.status_code == 405 # method not allowed
def setUp(self): self.client = client_for(Service(processes=[]))