mirror of
https://github.com/hydrosquall/tiingo-python.git
synced 2025-12-19 12:44:20 +01:00
Update test descriptions and simplify some assertions
This commit is contained in:
@@ -116,21 +116,23 @@ class TestTiingoWithPython(TestCase):
|
||||
|
||||
@vcr.use_cassette('tests/fixtures/ticker_price_with_volume_column.yaml')
|
||||
def test_get_dataframe_with_volume_column(self):
|
||||
"""Confirm that CSV endpoint works"""
|
||||
"""Confirm that requesting a single column works"""
|
||||
requested_column = "volume"
|
||||
prices = self._client.get_dataframe("GOOGL",
|
||||
columns="volume",
|
||||
columns=requested_column,
|
||||
fmt='json')
|
||||
assert len(prices) == 1
|
||||
assert len(prices.columns) == 2
|
||||
assert len(prices.columns) == len(requested_column) + 1
|
||||
|
||||
@vcr.use_cassette('tests/fixtures/ticker_price_with_multiple_columns.yaml')
|
||||
def test_get_dataframe_with_multiple_columns(self):
|
||||
"""Confirm that CSV endpoint works"""
|
||||
"""Confirm that requesting specific columns works"""
|
||||
requested_columns = "open,high,low,close,volume"
|
||||
prices = self._client.get_dataframe("GOOGL",
|
||||
columns="open,high,low,close,volume",
|
||||
columns=requested_columns,
|
||||
fmt='json')
|
||||
assert len(prices) == 1
|
||||
assert len(prices.columns) == 6
|
||||
assert len(prices.columns) == len(requested_columns.split(",")) + 1
|
||||
|
||||
def test_metric_name_column_error(self):
|
||||
with self.assertRaises(APIColumnNameError):
|
||||
|
||||
Reference in New Issue
Block a user