mirror of
https://github.com/hydrosquall/tiingo-python.git
synced 2025-12-18 04:14:20 +01:00
[dev] Update imports for custom exception classes
This commit is contained in:
@@ -6,7 +6,7 @@ from unittest import TestCase
|
|||||||
import vcr
|
import vcr
|
||||||
|
|
||||||
from tiingo import TiingoClient
|
from tiingo import TiingoClient
|
||||||
from tiingo.api import InvalidFrequencyError
|
from tiingo.exceptions import InvalidFrequencyError
|
||||||
from tiingo.restclient import RestClientError
|
from tiingo.restclient import RestClientError
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
import vcr
|
import vcr
|
||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
from tiingo import TiingoClient
|
from tiingo import TiingoClient
|
||||||
from tiingo.api import APIColumnNameError, InstallPandasException
|
from tiingo.exceptions import APIColumnNameError, InstallPandasException, MissingRequiredArgumentError
|
||||||
try:
|
try:
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
pandas_is_installed = True
|
pandas_is_installed = True
|
||||||
@@ -69,6 +69,10 @@ class TestTiingoWithPython(TestCase):
|
|||||||
self._client.get_dataframe(['GOOGL', 'AAPL'], startDate='2018-01-05',
|
self._client.get_dataframe(['GOOGL', 'AAPL'], startDate='2018-01-05',
|
||||||
endDate='2018-01-19', metric_name='xopen', frequency='weekly')
|
endDate='2018-01-19', metric_name='xopen', frequency='weekly')
|
||||||
|
|
||||||
|
def test_metric_name_missing_when_multiple_tickers(self):
|
||||||
|
with self.assertRaises(MissingRequiredArgumentError):
|
||||||
|
self._client.get_dataframe(['GOOGL', 'AAPL'], frequency='weekly')
|
||||||
|
|
||||||
@vcr.use_cassette('tests/fixtures/ticker_price_pandas_single.yaml')
|
@vcr.use_cassette('tests/fixtures/ticker_price_pandas_single.yaml')
|
||||||
def test_pandas_edge_case(self):
|
def test_pandas_edge_case(self):
|
||||||
"""Test single price/date being returned as a frame"""
|
"""Test single price/date being returned as a frame"""
|
||||||
|
|||||||
Reference in New Issue
Block a user