mirror of
https://github.com/wassname/options_backtester.git
synced 2026-08-11 11:22:33 +08:00
adding details on test
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user