From cb41086f74f3286671ecb5f3a18082c3a2f0ad1d Mon Sep 17 00:00:00 2001 From: Catalina Syddall Date: Mon, 22 Jul 2019 16:12:13 -0300 Subject: [PATCH] adding details on test --- data_scraper/test/test_cboe.py | 2 +- data_scraper/test/test_tiingo.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) 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)