mirror of
https://github.com/hydrosquall/tiingo-python.git
synced 2025-12-19 12:44:20 +01:00
Add columns param to get_ticker_price, including tests
This commit is contained in:
@@ -114,6 +114,24 @@ class TestTiingoWithPython(TestCase):
|
||||
frequency="30Min")
|
||||
self.assertGreater(len(prices), 1)
|
||||
|
||||
@vcr.use_cassette('tests/fixtures/ticker_price_with_volume_column.yaml')
|
||||
def test_get_dataframe_with_volume_column(self):
|
||||
"""Confirm that CSV endpoint works"""
|
||||
prices = self._client.get_dataframe("GOOGL",
|
||||
columns="volume",
|
||||
fmt='json')
|
||||
assert len(prices) == 1
|
||||
assert len(prices.columns) == 2
|
||||
|
||||
@vcr.use_cassette('tests/fixtures/ticker_price_with_multiple_columns.yaml')
|
||||
def test_get_dataframe_with_multiple_columns(self):
|
||||
"""Confirm that CSV endpoint works"""
|
||||
prices = self._client.get_dataframe("GOOGL",
|
||||
columns="open,high,low,close,volume",
|
||||
fmt='json')
|
||||
assert len(prices) == 1
|
||||
assert len(prices.columns) == 6
|
||||
|
||||
def test_metric_name_column_error(self):
|
||||
with self.assertRaises(APIColumnNameError):
|
||||
self._client.get_dataframe(['GOOGL', 'AAPL'], startDate='2018-01-05',
|
||||
|
||||
Reference in New Issue
Block a user