예제 #1
0
 def hit(self, url):
     with count_queries('url:' + url):
         response = self.client.get(url)
     self.assertEqual(200, response.status_code)
     text = response.content.decode('utf-8')
     if response['Content-Type'] == 'application/json':
         return json.loads(text)
     else:
         return text
예제 #2
0
파일: test_rest.py 프로젝트: Linaro/squad
 def hit(self, url):
     with count_queries('url:' + url):
         response = self.client.get(url)
     self.assertEqual(200, response.status_code)
     text = response.content.decode('utf-8')
     if response['Content-Type'] == 'application/json':
         return json.loads(text)
     else:
         return text
예제 #3
0
파일: test_basics.py 프로젝트: chaws/squad
 def hit(self, url, expected_status=200):
     with count_queries('url:' + url):
         response = self.client.get(url)
     self.assertEqual(expected_status, response.status_code)
     return response
예제 #4
0
 def get_json(self, url):
     with count_queries('url:' + url):
         response = self.client.get_json(url)
     return response
예제 #5
0
파일: test_basics.py 프로젝트: Linaro/squad
 def hit(self, url, expected_status=200):
     with count_queries('url:' + url):
         response = self.client.get(url)
     self.assertEqual(expected_status, response.status_code)
     return response