Update test descriptions and simplify some assertions

This commit is contained in:
Koen werklaptop
2024-10-28 20:54:53 +01:00
parent 9277e3363b
commit 355c2812ff
2 changed files with 10 additions and 8 deletions

View File

@@ -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):