diff --git a/data_scraper/test/test_cboe.py b/data_scraper/test/test_cboe.py index eb61854..78a6483 100644 --- a/data_scraper/test/test_cboe.py +++ b/data_scraper/test/test_cboe.py @@ -81,7 +81,7 @@ class TestCBOE(unittest.TestCase): @patch("data_scraper.cboe.url", new="http://www.aldkfjaskldfjsa.com") @patch("data_scraper.cboe.retry_failure", return_value=None) def test_retry(self, mocked_retry): - """Raise ConnectionError and send notification when host is unreachable""" + """Raise ConnectionError and retry when host is unreachable""" with self.assertRaises(ConnectionError): cboe.fetch_data(["SPX"]) self.assertTrue(mocked_retry.called) diff --git a/data_scraper/test/test_tiingo.py b/data_scraper/test/test_tiingo.py index b1407b1..e250abd 100644 --- a/data_scraper/test/test_tiingo.py +++ b/data_scraper/test/test_tiingo.py @@ -58,8 +58,10 @@ class TestTiingo(unittest.TestCase): @patch("data_scraper.tiingo.pdr.get_data_tiingo") # mock pandas_datareader @patch("data_scraper.tiingo.slack_notification", return_value=None) - def test_no_connection(self, mocked_notification): + def test_no_connection(self, mocked_notification, mocked_pdr): """Raise ConnectionError and send notification when host is unreachable""" + mocked_pdr.side_effect = ConnectionError("This is a test") + with self.assertRaises(ConnectionError): tiingo.fetch_data(["IBM"]) self.assertTrue(mocked_notification.called)