def test_parse_response_error_not_none(self): response = MockResponse( '{"quoteResponse": {"error": "Non-zero error", "result": [{}]}}') with self.assertRaises(yahoo.YahooError): yahoo.parse_response(response)
def test_parse_response_error_invalid_format(self): response = MockResponse( """{"quoteResponse": {"error": null, "result": [{}]}, "chart": {"error": null, "result": [{}]}}""") with self.assertRaises(yahoo.YahooError): yahoo.parse_response(response)
def test_parse_response_error_status_code(self): response = MockResponse( '{"quoteResponse": {"error": "Not supported", "result": [{}]}}', status_code=400) with self.assertRaises(yahoo.YahooError): yahoo.parse_response(response)
def test_parse_response_error_not_none(self): response = MockResponse( {'quoteResponse': {'error': 'Non-zero error', 'result': [{}]}}) with self.assertRaises(yahoo.YahooError): yahoo.parse_response(response)
def test_parse_response_error_invalid_format(self): response = MockResponse( {'quoteResponse': {'error': None, 'result': [{}]}, 'chart': {'error': None, 'result': [{}]}}) with self.assertRaises(yahoo.YahooError): yahoo.parse_response(response)
def test_parse_response_error_status_code(self): response = MockResponse( {'quoteResponse': {'error': 'Not supported', 'result': [{}]}}, status_code=400) with self.assertRaises(yahoo.YahooError): yahoo.parse_response(response)