Esempio n. 1
0
 def test_check_err_with_404_with_flag(self):
     resp = Mock(headers={}, status_code=404)
     resp.json.return_value = {"code": "resource_not_consistent"}
     url_suffix = ""
     data = None
     with self.assertRaises(DSResourceNotConsistentError):
         DataServiceApi._check_err(resp, url_suffix, data, allow_pagination=False)
Esempio n. 2
0
 def test_check_err_with_404(self):
     resp = Mock(headers={}, status_code=404)
     resp.json.return_value = {"code": "not_found"}
     url_suffix = ""
     data = None
     with self.assertRaises(DataServiceError):
         DataServiceApi._check_err(resp, url_suffix, data, allow_pagination=False)
Esempio n. 3
0
 def test_check_err_with_400(self):
     resp = Mock(headers={}, status_code=400)
     url_suffix = ""
     data = None
     with self.assertRaises(DataServiceError):
         DataServiceApi._check_err(resp, url_suffix, data, allow_pagination=False)
Esempio n. 4
0
 def test_check_err_with_good_response(self):
     resp = Mock(headers={}, status_code=202)
     url_suffix = ""
     data = None
     DataServiceApi._check_err(resp, url_suffix, data, allow_pagination=False)