Fix tests

This commit is contained in:
Koen werklaptop
2024-11-03 20:01:54 +01:00
parent 027bd0d1c6
commit 27e634d807
2 changed files with 4 additions and 2 deletions

View File

@@ -115,10 +115,12 @@ class TestTickerPrices(TestCase):
@vcr.use_cassette('tests/fixtures/ticker_price_with_multiple_columns.yaml') @vcr.use_cassette('tests/fixtures/ticker_price_with_multiple_columns.yaml')
def test_ticker_price_with_multiple_columns(self): def test_ticker_price_with_multiple_columns(self):
"""Confirm that requesting specific columns works""" """Confirm that requesting specific columns works"""
requested_columns = "open,high,low,close,volume"
prices = self._client.get_ticker_price("GOOGL", prices = self._client.get_ticker_price("GOOGL",
columns="open,high,low,close,volume", columns=requested_columns,
fmt='json') fmt='json')
assert len(prices) == 1 assert len(prices) == 1
assert len(prices[0]) == len(requested_columns.split(',')) + 1
assert prices[0].get('date') assert prices[0].get('date')
assert prices[0].get('high') assert prices[0].get('high')
assert prices[0].get('low') assert prices[0].get('low')

View File

@@ -132,7 +132,7 @@ class TestTiingoWithPython(TestCase):
columns=requested_columns, columns=requested_columns,
fmt='json') fmt='json')
assert len(prices) == 1 assert len(prices) == 1
assert len(prices.columns) == len(requested_columns.split(",")) + 1 assert len(prices.columns) == len(requested_columns.split(','))
def test_metric_name_column_error(self): def test_metric_name_column_error(self):
with self.assertRaises(APIColumnNameError): with self.assertRaises(APIColumnNameError):