示例#1
0
 def test_query(self):
     from mme_server.server import app
     self.client = app.test_client()
     self.data = json.dumps(EXAMPLE_REQUEST)
     response = self.client.post('/v1/match', data=self.data, headers=self.headers)
     self.assertEqual(response.status_code, 200)
     self.assertEqual(response.headers['Content-Type'], 'application/vnd.ga4gh.matchmaker.v1.0+json')
     response_data = json.loads(response.get_data(as_text=True))
     validate_response(response_data)
     self.assertEqual(len(response_data['results']), 5)
    def test_query(self):
        from mme_server.server import app
        self.client = app.test_client()
        self.data = json.dumps(EXAMPLE_REQUEST)
        self.accept_header = ('Accept', 'application/vnd.ga4gh.matchmaker.v1.0+json')
        self.content_type_header = ('Content-Type', 'application/json')
        self.headers = [self.accept_header, self.content_type_header]

        response = self.client.post('/match', data=self.data, headers=self.headers)
        self.assertEqual(response.status_code, 200)
        self.assertEqual(response.headers['Content-Type'], 'application/vnd.ga4gh.matchmaker.v1.0+json')
        response_data = json.loads(response.get_data(as_text=True))
        validate_response(response_data)
        self.assertEqual(len(response_data['results']), 5)
示例#3
0
 def assertValidResponse(self, data):
     validate_response(data)
 def assertValidResponse(self, data):
     validate_response(data)