mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-30 14:02:06 +00:00
Improvements
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import pytest
|
||||
from openbb import obb
|
||||
from openbb_alpha_vantage.models.stock_historical import AVStockHistoricalFetcher
|
||||
from openbb_core.app.service.user_service import UserService
|
||||
|
||||
test_credentials = obb.user.credentials.__dict__
|
||||
test_credentials = UserService().default_user_settings.credentials.dict()
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import pytest
|
||||
from openbb import obb
|
||||
from openbb_benzinga.models.global_news import BenzingaGlobalNewsFetcher
|
||||
from openbb_benzinga.models.stock_news import BenzingaStockNewsFetcher
|
||||
from openbb_core.app.service.user_service import UserService
|
||||
|
||||
test_credentials = obb.user.credentials.__dict__
|
||||
test_credentials = UserService().default_user_settings.credentials.dict()
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import pytest
|
||||
from openbb import obb
|
||||
from openbb_cboe.models.available_indices import CboeAvailableIndicesFetcher
|
||||
from openbb_cboe.models.european_index_constituents import (
|
||||
CboeEuropeanIndexConstituentsFetcher,
|
||||
@@ -17,8 +16,9 @@ from openbb_cboe.models.options_chains import CboeOptionsChainsFetcher
|
||||
from openbb_cboe.models.stock_historical import CboeStockHistoricalFetcher
|
||||
from openbb_cboe.models.stock_info import CboeStockInfoFetcher
|
||||
from openbb_cboe.models.stock_search import CboeStockSearchFetcher
|
||||
from openbb_core.app.service.user_service import UserService
|
||||
|
||||
test_credentials = obb.user.credentials.__dict__
|
||||
test_credentials = UserService().default_user_settings.credentials.dict()
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import pytest
|
||||
from openbb import obb
|
||||
from openbb_core.app.service.user_service import UserService
|
||||
from openbb_fmp.models.analyst_estimates import FMPAnalystEstimatesFetcher
|
||||
from openbb_fmp.models.available_indices import FMPAvailableIndicesFetcher
|
||||
from openbb_fmp.models.balance_sheet import FMPBalanceSheetFetcher
|
||||
@@ -45,7 +45,7 @@ from openbb_fmp.models.stock_quote import FMPStockQuoteFetcher
|
||||
from openbb_fmp.models.stock_splits import FMPStockSplitCalendarFetcher
|
||||
from openbb_fmp.models.treasury_rates import FMPTreasuryRatesFetcher
|
||||
|
||||
test_credentials = obb.user.credentials.__dict__
|
||||
test_credentials = UserService().default_user_settings.credentials.dict()
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import pytest
|
||||
from openbb import obb
|
||||
from openbb_core.app.service.user_service import UserService
|
||||
from openbb_fred.models.ameribor_rates import FREDAMERIBORFetcher
|
||||
from openbb_fred.models.cpi import FREDCPIFetcher
|
||||
from openbb_fred.models.estr_rates import FREDESTRFetcher
|
||||
@@ -10,7 +10,7 @@ from openbb_fred.models.sofr_rates import FREDSOFRFetcher
|
||||
from openbb_fred.models.sonia_rates import FREDSONIAFetcher
|
||||
from openbb_fred.models.us_yield_curve import FREDYieldCurveFetcher
|
||||
|
||||
test_credentials = obb.user.credentials.__dict__
|
||||
test_credentials = UserService().default_user_settings.credentials.dict()
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import pytest
|
||||
from openbb import obb
|
||||
from openbb_core.app.service.user_service import UserService
|
||||
from openbb_intrinio.models.balance_sheet import IntrinioBalanceSheetFetcher
|
||||
from openbb_intrinio.models.cash_flow import IntrinioCashFlowStatementFetcher
|
||||
from openbb_intrinio.models.forex_pairs import IntrinioForexPairsFetcher
|
||||
@@ -10,7 +10,7 @@ from openbb_intrinio.models.stock_historical import IntrinioStockHistoricalFetch
|
||||
from openbb_intrinio.models.stock_news import IntrinioStockNewsFetcher
|
||||
from openbb_intrinio.models.stock_quote import IntrinioStockQuoteFetcher
|
||||
|
||||
test_credentials = obb.user.credentials.__dict__
|
||||
test_credentials = UserService().default_user_settings.credentials.dict()
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import pytest
|
||||
from openbb import obb
|
||||
from openbb_core.app.service.user_service import UserService
|
||||
from openbb_polygon.models.balance_sheet import PolygonBalanceSheetFetcher
|
||||
from openbb_polygon.models.cash_flow import PolygonCashFlowStatementFetcher
|
||||
from openbb_polygon.models.crypto_historical import PolygonCryptoHistoricalFetcher
|
||||
@@ -12,7 +12,7 @@ from openbb_polygon.models.major_indices_historical import (
|
||||
from openbb_polygon.models.stock_historical import PolygonStockHistoricalFetcher
|
||||
from openbb_polygon.models.stock_news import PolygonStockNewsFetcher
|
||||
|
||||
test_credentials = obb.user.credentials.__dict__
|
||||
test_credentials = UserService().default_user_settings.credentials.dict()
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import pytest
|
||||
from openbb import obb
|
||||
from openbb_core.app.service.user_service import UserService
|
||||
from openbb_quandl.models.cot import QuandlCotFetcher
|
||||
from openbb_quandl.models.cot_search import QuandlCotSearchFetcher
|
||||
from openbb_quandl.models.sp500_multiples import QuandlSP500MultiplesFetcher
|
||||
|
||||
test_credentials = obb.user.credentials.__dict__
|
||||
test_credentials = UserService().default_user_settings.credentials.dict()
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
|
||||
@@ -31,7 +31,9 @@ def generate_fetcher_unit_tests(path: str) -> None:
|
||||
"""Generate the fetcher unit tests in the provider test folders."""
|
||||
if not os.path.exists(path):
|
||||
with open(path, "w") as f:
|
||||
f.write("import pytest\nfrom openbb import obb\n")
|
||||
f.write(
|
||||
"import pytest\nfrom openbb_core.app.service.user_service import UserService\n"
|
||||
)
|
||||
|
||||
|
||||
def get_test_params(param_fields: Dict[str, ModelField]) -> Dict[str, Any]:
|
||||
@@ -71,7 +73,7 @@ def write_test_credentials(path: str, provider: str) -> None:
|
||||
credentials: Dict[str, str] = test_credentials.get(provider, {})
|
||||
|
||||
template = """
|
||||
test_credentials = obb.user.credentials.__dict__
|
||||
test_credentials = UserService().default_user_settings.credentials.dict()
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import pytest
|
||||
from openbb import obb
|
||||
from openbb_core.app.service.user_service import UserService
|
||||
from openbb_yfinance.models.available_indices import YFinanceAvailableIndicesFetcher
|
||||
from openbb_yfinance.models.balance_sheet import YFinanceBalanceSheetFetcher
|
||||
from openbb_yfinance.models.cash_flow import YFinanceCashFlowStatementFetcher
|
||||
@@ -14,7 +14,7 @@ from openbb_yfinance.models.major_indices_historical import (
|
||||
from openbb_yfinance.models.stock_historical import YFinanceStockHistoricalFetcher
|
||||
from openbb_yfinance.models.stock_news import YFinanceStockNewsFetcher
|
||||
|
||||
test_credentials = obb.user.credentials.__dict__
|
||||
test_credentials = UserService().default_user_settings.credentials.dict()
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
|
||||
Reference in New Issue
Block a user