Fix #44: Raise explicit error when API Key is missing

This commit is contained in:
Cameron Yick
2017-12-24 13:19:03 -05:00
committed by Cameron Yick
parent e80b3f6dfd
commit 9dbfbcbdbb
2 changed files with 15 additions and 1 deletions

View File

@@ -25,6 +25,17 @@ def test_client_repr():
assert repr(client) == "<TiingoClient(url=\"{}\")>".format(base_url)
class TestClient(TestCase):
def test_api_key_missing_error(self):
config = {
'api_key': ""
}
with self.assertRaises(RuntimeError):
client = TiingoClient(config=config)
assert client
# PRICES ENDPOINTS
class TestTickerPrices(TestCase):