Skip to content

Commit

Permalink
revised integration
Browse files Browse the repository at this point in the history
  • Loading branch information
AdiSai committed Nov 7, 2023
1 parent b9a7f85 commit 13a19aa
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 11 deletions.
1 change: 1 addition & 0 deletions openbb_platform/dev_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
openbb-core = { path = "./platform/core", develop = true }
openbb-benzinga = { path = "./providers/benzinga", develop = true }
openbb-ultima = { path = "./providers/ultima", develop = true }
openbb-fmp = { path = "./providers/fmp", develop = true }
openbb-fred = { path = "./providers/fred", develop = true }
openbb-intrinio = { path = "./providers/intrinio", develop = true }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,12 @@ def test_stocks_load(params, headers):
"limit": 20,
}
),
(
{
"provider": "ultima",
"symbols": "AAPL,MSFT",
}
),
],
)
@pytest.mark.integration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,12 @@ def test_stocks_load(params, obb):
"limit": 20,
}
),
(
{
"provider": "ultima",
"symbols": "AAPL,MSFT",
}
),
],
)
@pytest.mark.integration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Benzinga Helpers."""
"""Ultima Helpers."""


from typing import Any, Dict
Expand All @@ -9,7 +9,7 @@
def get_data(url: str, **kwargs: Any) -> Dict:
"""Do an API request to Ultima and return the data."""
auth = kwargs.pop("auth", "")
if len(auth) == 0:
if auth is None or len(auth) == 0:
raise RuntimeError("Ultima API key is required.")
if "Bearer" not in auth:
auth = f"Bearer {auth}"
Expand Down
2 changes: 1 addition & 1 deletion openbb_platform/providers/ultima/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "openbb-ultima"
version = "0.1.0a5"
version = "0.1.0a6"
description = "Ultima Insights extension for OpenBB"
authors = ["Ultima Insights Team <[email protected]>"]
readme = "README.md"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ interactions:
headers:
Accept-Encoding:
- gzip, deflate
Authorization:
- Bearer 7e6e31df-039f-4acf-aa39-c14bf6bb2ade
Connection:
- keep-alive
accept:
Expand Down
11 changes: 5 additions & 6 deletions openbb_platform/providers/ultima/tests/test_ultima_fetchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@
from openbb_core.app.service.user_service import UserService
from openbb_ultima.models.stock_news import UltimaStockNewsFetcher

test_credentials = UserService().default_user_settings.credentials.dict()
test_credentials = UserService().default_user_settings.credentials.model_dump(
mode="json"
)


@pytest.fixture(scope="module")
def vcr_config():
return {
"filter_headers": [("User-Agent", None)],
"filter_query_parameters": [
("token", "MOCK_TOKEN"),
],
"filter_headers": [("User-Agent", None), ("Authorization", None)],
}


@pytest.mark.record_http
def test_ultima_stock_news_fetcher(credentials={}):
def test_ultima_stock_news_fetcher(credentials=test_credentials):
params = {"symbols": "AAPL, MSFT"}

fetcher = UltimaStockNewsFetcher()
Expand Down
1 change: 1 addition & 0 deletions openbb_platform/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ python = ">=3.8,<3.12"
openbb-core = "^0.1.0a5"

openbb-benzinga = "^0.1.0a4"
openbb-ultima = "^0.1.0a6"
openbb-fmp = "^0.1.0a4"
openbb-fred = "^0.1.0a4"
openbb-intrinio = "^0.1.0a4"
Expand Down

0 comments on commit 13a19aa

Please sign in to comment.