adding details on test

This commit is contained in:
Catalina Syddall
2019-07-22 16:12:13 -03:00
parent 148ffc9ea1
commit cb41086f74
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -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)
+3 -1
View File
@@ -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)