Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply renaming to news data #5684

Merged
merged 24 commits into from
Nov 8, 2023
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
9796dc6
Merge pull request #4 from Ultima-Insights/develop
AdiSai Oct 13, 2023
c2d767a
Merge branch 'OpenBB-finance:develop' into feature/Ultima-Platform-In…
AdiSai Oct 17, 2023
33be6ea
Merge pull request #5 from Ultima-Insights/develop
AdiSai Oct 19, 2023
ce7012f
Merge pull request #6 from OpenBB-finance/feature/openbb-sdk-v4
AdiSai Oct 19, 2023
edf779f
Merge pull request #7 from OpenBB-finance/feature/openbb-sdk-v4
AdiSai Oct 26, 2023
f4baa6e
Merge pull request #8 from OpenBB-finance/feature/openbb-sdk-v4
AdiSai Oct 27, 2023
99adb07
Merge pull request #9 from OpenBB-finance/feature/openbb-sdk-v4
AdiSai Oct 31, 2023
4564b52
Merge pull request #10 from OpenBB-finance/feature/openbb-sdk-v4
AdiSai Oct 31, 2023
645976f
inegration complete
AdiSai Oct 31, 2023
a9e1a76
reformatted for black
AdiSai Oct 31, 2023
150a31a
fix ruff issues
AdiSai Oct 31, 2023
89b6adc
Merge pull request #11 from OpenBB-finance/feature/openbb-sdk-v4
AdiSai Nov 6, 2023
b9a7f85
Merge pull request #12 from OpenBB-finance/feature/openbb-sdk-v4
AdiSai Nov 7, 2023
13a19aa
revised integration
AdiSai Nov 7, 2023
99f8890
Merge pull request #13 from OpenBB-finance/feature/openbb-sdk-v4
AdiSai Nov 8, 2023
cbebeaf
changes to versions in pyproject.toml and updated lock files
AdiSai Nov 8, 2023
0a16d12
Rename models
piiq Nov 8, 2023
971c6bc
Update tests
piiq Nov 8, 2023
21707c8
Fix typos here and there
piiq Nov 8, 2023
390652e
Update routers
piiq Nov 8, 2023
0e0fa40
Merge branch 'pr/AdiSai/5639' into feature/news-rename
piiq Nov 8, 2023
7c49269
Apply rename to ultima
piiq Nov 8, 2023
54238bc
Properly mock api key
piiq Nov 8, 2023
0be2996
Mock ultima api key
piiq Nov 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply rename to ultima
piiq committed Nov 8, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 7c49269169a1879eeb3d050d83286b85f7e6bca2
82 changes: 80 additions & 2 deletions openbb_platform/extensions/news/integration/test_news_api.py
Original file line number Diff line number Diff line change
@@ -8,6 +8,9 @@ def headers():
return {}


# pylint: disable=redefined-outer-name


@pytest.mark.parametrize(
"params",
[
@@ -56,11 +59,86 @@ def headers():
],
)
@pytest.mark.integration
def test_news_globalnews(params, headers):
def test_news_world(params, headers):
params = {p: v for p, v in params.items() if v}

query_str = get_querystring(params, [])
url = f"http://0.0.0.0:8000/api/v1/news/world?{query_str}"
result = requests.get(url, headers=headers, timeout=10)
assert isinstance(result, requests.Response)
assert result.status_code == 200


@pytest.mark.parametrize(
"params",
[
({"symbols": "AAPL", "limit": 20, "provider": "benzinga"}),
(
{
"display": "full",
"date": "2023-01-01",
"start_date": "2023-01-01",
"end_date": "2023-06-06",
"updated_since": 1,
"published_since": 1,
"sort": "created",
"order": "desc",
"isin": "US0378331005",
"cusip": "037833100",
"channels": "General",
"topics": "AAPL",
"authors": "Benzinga Insights",
"content_types": "headline",
"provider": "benzinga",
"symbols": "AAPL,MSFT",
"limit": 20,
}
),
(
{
"published_utc": "2023-01-01",
"order": "desc",
"provider": "polygon",
"symbols": "AAPL",
"limit": 20,
}
),
(
{
"provider": "fmp",
"symbols": "AAPL",
"limit": 20,
"page": 1,
}
),
(
{
"provider": "yfinance",
"symbols": "AAPL",
"limit": 20,
}
),
(
{
"provider": "intrinio",
"symbols": "AAPL",
"limit": 20,
}
),
(
{
"provider": "ultima",
"symbols": "AAPL,MSFT",
}
),
],
)
@pytest.mark.integration
def test_news_company(params, headers):
params = {p: v for p, v in params.items() if v}

query_str = get_querystring(params, [])
url = f"http://0.0.0.0:8000/api/v1/news/globalnews?{query_str}"
url = f"http://0.0.0.0:8000/api/v1/news/company?{query_str}"
result = requests.get(url, headers=headers, timeout=10)
assert isinstance(result, requests.Response)
assert result.status_code == 200
85 changes: 81 additions & 4 deletions openbb_platform/extensions/news/integration/test_news_python.py
Original file line number Diff line number Diff line change
@@ -5,15 +5,18 @@


@pytest.fixture(scope="session")
def obb(pytestconfig):
def obb(pytestconfig): # pylint: disable=inconsistent-return-statements
"""Fixture to setup obb."""

if pytestconfig.getoption("markexpr") != "not integration":
import openbb
import openbb # pylint: disable=import-outside-toplevel

return openbb.obb


# pylint: disable=redefined-outer-name


@pytest.mark.parametrize(
"params",
[
@@ -62,7 +65,81 @@ def obb(pytestconfig):
],
)
@pytest.mark.integration
def test_news_globalnews(params, obb):
result = obb.news.globalnews(**params)
def test_news_world(params, obb):
result = obb.news.world(**params)
assert result
assert isinstance(result, OBBject)


@pytest.mark.parametrize(
"params",
[
({"symbols": "AAPL,MSFT", "limit": 20}),
(
{
"display": "full",
"date": "2023-01-01",
"start_date": "2023-01-01",
"end_date": "2023-06-06",
"updated_since": 1,
"published_since": 1,
"sort": "created",
"order": "desc",
"isin": "US0378331005",
"cusip": "037833100",
"channels": "General",
"topics": "AAPL",
"authors": "Benzinga Insights",
"content_types": "headline",
"provider": "benzinga",
"symbols": "AAPL,MSFT",
"limit": 20,
}
),
(
{
"published_utc": "2023-01-10",
"order": "desc",
"provider": "polygon",
"symbols": "AAPL",
"limit": 20,
}
),
(
{
"provider": "fmp",
"symbols": "AAPL",
"limit": 20,
"page": 1,
}
),
(
{
"provider": "yfinance",
"symbols": "AAPL",
"limit": 20,
}
),
(
{
"provider": "intrinio",
"symbols": "AAPL",
"limit": 20,
}
),
(
{
"provider": "ultima",
"symbols": "AAPL,MSFT",
}
),
],
)
@pytest.mark.integration
def test_news_company(params, obb):
params = {p: v for p, v in params.items() if v}

result = obb.news.company(**params)
assert result
assert isinstance(result, OBBject)
assert len(result.results) > 0
13 changes: 12 additions & 1 deletion openbb_platform/extensions/news/openbb_news/news_router.py
Original file line number Diff line number Diff line change
@@ -16,11 +16,22 @@


@router.command(model="GlobalNews")
def globalnews(
def world(
cc: CommandContext,
provider_choices: ProviderChoices,
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject[BaseModel]:
"""Global News. Global news data."""
return OBBject(results=Query(**locals()).execute())


@router.command(model="CompanyNews")
def company(
cc: CommandContext,
provider_choices: ProviderChoices,
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject[BaseModel]:
"""Company News. Get news for one or more companies."""
return OBBject(results=Query(**locals()).execute())
Original file line number Diff line number Diff line change
@@ -152,10 +152,10 @@ def extract_data(

base_url = "https://api.benzinga.com/api/v2/news"

query.sort = f"{query.sort}:{query.order}" # type: ignore
query.sort = f"{query.sort}:{query.order}" if query.sort and query.order else ""
querystring = get_querystring(query.model_dump(by_alias=True), ["order"])

pages = math.ceil(query.limit / 100) # type: ignore
pages = math.ceil(query.limit / 100) if query.limit else 1
data = []

for page in range(pages):
4 changes: 2 additions & 2 deletions openbb_platform/providers/ultima/openbb_ultima/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"""Ultima provider module."""
from openbb_provider.abstract.provider import Provider
from openbb_ultima.models.stock_news import UltimaStockNewsFetcher
from openbb_ultima.models.company_news import UltimaCompanyNewsFetcher

ultima_provider = Provider(
name="ultima",
website="https://www.ultimainsights.ai/openbb",
description="""Ultima harnesses the power of LLMs to deliver news before it hits the frontpage of Bloomberg.""",
required_credentials=["api_key"],
fetcher_dict={
"StockNews": UltimaStockNewsFetcher,
"CompanyNews": UltimaCompanyNewsFetcher,
},
)
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
"""Ultima Stock News Fetcher."""
"""Ultima Company News Fetcher."""


from datetime import datetime
from typing import Any, Dict, List, Optional

from openbb_provider.abstract.fetcher import Fetcher
from openbb_provider.standard_models.stock_news import (
StockNewsData,
StockNewsQueryParams,
from openbb_provider.standard_models.company_news import (
CompanyNewsData,
CompanyNewsQueryParams,
)
from openbb_ultima.utils.helpers import get_data
from pydantic import Field


class UltimaStockNewsQueryParams(StockNewsQueryParams):
"""Ultima Stock News query.
class UltimaCompanyNewsQueryParams(CompanyNewsQueryParams):
"""Ultima Company News query.

Source: https://api.ultimainsights.ai/v1/api-docs#/default/get_v1_getOpenBBProInsights__tickers_
"""
@@ -24,8 +24,8 @@ class UltimaStockNewsQueryParams(StockNewsQueryParams):
}


class UltimaStockNewsData(StockNewsData):
"""Ultima Stock News Data."""
class UltimaCompanyNewsData(CompanyNewsData):
"""Ultima Company News Data."""

__alias_dict__ = {"date": "publishedDate", "text": "summary", "title": "headline"}

@@ -34,22 +34,26 @@ class UltimaStockNewsData(StockNewsData):
riskCategory: str = Field(description="Risk category of the news.")


class UltimaStockNewsFetcher(
class UltimaCompanyNewsFetcher(
Fetcher[
UltimaStockNewsQueryParams,
List[UltimaStockNewsData],
UltimaCompanyNewsQueryParams,
List[UltimaCompanyNewsData],
]
):
"""Ultima Company News Fetcher."""

@staticmethod
def transform_query(params: Dict[str, Any]) -> UltimaStockNewsQueryParams:
return UltimaStockNewsQueryParams(**params)
def transform_query(params: Dict[str, Any]) -> UltimaCompanyNewsQueryParams:
"""Transform query."""
return UltimaCompanyNewsQueryParams(**params)

@staticmethod
def extract_data(
query: UltimaStockNewsQueryParams,
query: UltimaCompanyNewsQueryParams,
credentials: Optional[Dict[str, str]],
**kwargs: Any,
) -> Dict:
) -> List[Dict]:
"""Extract data from Ultima Insights API."""
token = credentials.get("ultima_api_key") if credentials else ""
kwargs["auth"] = token

@@ -66,10 +70,11 @@ def extract_data(

@staticmethod
def transform_data(
query: UltimaStockNewsQueryParams,
query: UltimaCompanyNewsQueryParams,
data: List[Dict],
**kwargs: Any,
) -> List[UltimaStockNewsData]:
) -> List[UltimaCompanyNewsData]:
"""Transform data."""
results = []
for ele in data:
for key in ["8k_filings", "articles", "industry_summary"]:
@@ -82,5 +87,5 @@ def transform_data(
item["title"] = item["headline"]
item["url"] = item["url"]
item["publisher"] = item["publisher"]
results.append(UltimaStockNewsData.model_validate(item))
results.append(UltimaCompanyNewsData.model_validate(item))
return results
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
interactions:
- request:
body: null
headers:
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
accept:
- application/json
method: GET
uri: https://api.ultimainsights.ai/v1/getOpenBBProInsights/AAPL,MSFT
response:
body:
string: "[\n {\n \"8k_filings\": [],\n \"articles\": [\n {\n \"headline\":
\"AAPL - Apple Inc. Follow 2.64M Followers. Recommended For You. Samuel Smith
profile picture. Charlie Munger Says Investors Have To Buy These Stocks ...\",\n
\ \"publishedDate\": \"2023-11-06 17:44:36\",\n \"publisher\":
\"Seeking Alpha\",\n \"riskCategory\": \"Financial News\",\n \"summary\":
\"AAPL's strong profitability, new hardware launches, and potential for growth
in the services segment position the company well for the future. The article
highlights AAPL's ability to generate profits, return capital to shareholders,
and dominate the market. The author believes that AAPL's best days are not
behind them and sees potential for the stock to reach a $3.48 trillion market
cap in 2024.\",\n \"url\": \"https://seekingalpha.com/article/4647665-apple-stop-focusing-on-revenue-and-focus-on-profits\"\n
\ },\n {\n \"headline\": \"The U.S. International Trade Commission
on Oct. 26 ruled in favor of Masimo (Nasdaq: MASI) against Apple Inc., the
world's most valuable publicly ...\",\n \"publishedDate\":
\"2023-11-07 01:42:52\",\n \"publisher\": \"Orange County Business
Journal\",\n \"riskCategory\": \"Financial News\",\n \"summary\":
\"Masimo Corp. wins ruling against Apple in patent infringement case, potentially
halting importation of Apple's newest watches.\",\n \"url\": \"https://www.ocbj.com/manufacturing/masimo-earns-itc-win-against-apple/\"\n
\ },\n {\n \"headline\": \"Despite a setback in a similar
lawsuit against Apple in 2021 and a subsequent failed appeal, Epic is now
petitioning the Supreme Court to consider its ...\",\n \"publishedDate\":
\"2023-11-06 14:16:59\",\n \"publisher\": \"ReadWrite\",\n \"riskCategory\":
\"Legal News\",\n \"summary\": \"Epic Games is taking Google to court
over antitrust violations in the Play Store. This legal confrontation adds
to Google's ongoing antitrust lawsuit from the Department of Justice. The
outcome of the trial remains uncertain, but it could have implications for
Apple's app store model.\",\n \"url\": \"https://readwrite.com/epic-games-vs-google-a-new-chapter-in-the-app-store-antitrust-saga/\"\n
\ }\n ],\n \"critical_factors\": {},\n \"earnings_summary\":
{},\n \"industry_summary\": [\n {\n \"headline\": \"Apple Profits
Focus\",\n \"publishedDate\": \"2023-11-06 17:44:36\",\n \"publisher\":
\"Seeking Alpha\",\n \"riskCategory\": \"Financial News\",\n \"summary\":
\"Apple reported a decline in YoY revenue of -2.8% (-$11.04 billion) but generated
$97 billion in net income. Services segment grew 9.05% YoY and is expected
to reach $100 billion in revenue by 2025.\",\n \"url\": \"https://seekingalpha.com/article/4647665-apple-stop-focusing-on-revenue-and-focus-on-profits\"\n
\ },\n {\n \"headline\": \"Masimo ITC Win\",\n \"publishedDate\":
\"2023-11-07 01:42:52\",\n \"publisher\": \"Orange County Business
Journal\",\n \"riskCategory\": \"Financial News\",\n \"summary\":
\"Masimo Corp. wins a ruling against Apple Inc. from the U.S. International
Trade Commission, potentially halting the importation of Apple's newest watches.\",\n
\ \"url\": \"https://www.ocbj.com/manufacturing/masimo-earns-itc-win-against-apple/\"\n
\ },\n {\n \"headline\": \"Epic Games Google Lawsuit\",\n
\ \"publishedDate\": \"2023-11-06 14:16:59\",\n \"publisher\":
\"ReadWrite\",\n \"riskCategory\": \"Legal News\",\n \"summary\":
\"Epic Games is suing Google for antitrust violations in the Play Store, accusing
it of obstructing competing app stores and inflating fees. The trial is ongoing.\",\n
\ \"url\": \"https://readwrite.com/epic-games-vs-google-a-new-chapter-in-the-app-store-antitrust-saga/\"\n
\ }\n ],\n \"metadata\": {\n \"has_industry_summary\": true,\n
\ \"is_day_after_earnings\": false,\n \"is_day_before_or_of_earnings\":
false,\n \"n_8k_articles_with_summaries\": 0,\n \"n_articles_with_summaries\":
3,\n \"n_pr_articles_with_summaries\": 0\n },\n \"pr_articles\":
[],\n \"ticker\": \"AAPL\"\n },\n {\n \"8k_filings\": [],\n \"articles\":
[\n {\n \"headline\": \"The company has already built its own
large language models in what has become an artificial intelligence arms race
between Microsoft Corporation ...\",\n \"publishedDate\": \"2023-11-06
18:05:45\",\n \"publisher\": \"Proactive Investors\",\n \"riskCategory\":
\"Financial News\",\n \"summary\": \"German startup Aleph Alpha raises
$500M in funding, challenging Open AI in the large language model market.
Microsoft-backed Open AI and Google's Bard are also competitors. Aleph Alpha
focuses on data sovereignty, a concept gaining popularity among European lawmakers.
Its training data includes public documents published by the European Parliament.\",\n
\ \"url\": \"https://www.proactiveinvestors.com/companies/news/1032232/openai-s-german-rival-raises-500m-from-sap-hewlett-packard-enterprise-and-others-1032232.html\"\n
\ },\n {\n \"headline\": \"Microsoft Corp. and Alphabet Inc.
reported their third-quarter earnings on Oct. 24, displaying contrasting performance
in each cloud-based ...\",\n \"publishedDate\": \"2023-11-06 14:03:35\",\n
\ \"publisher\": \"The Ticker\",\n \"riskCategory\": \"Financial
News\",\n \"summary\": \"Microsoft showcased a 13% increase in revenue,
a 27% increase in net income, and a 19% increase in revenue from its intelligent
cloud business in Q3. Microsoft Azure grew 29%, surpassing investor expectations.
The company's early investments in AI are starting to pay off, leading the
competition.\",\n \"url\": \"https://theticker.org/12690/business/big-tech-q3-earnings-showcase-intense-competition-in-cloud-computing/\"\n
\ },\n {\n \"headline\": \"Although quarterly revenues and
earnings beat consensus estimates, management pointed out that they would
be ramping up capital expenditures to ...\",\n \"publishedDate\":
\"2023-11-06 09:26:07\",\n \"publisher\": \"Yahoo Finance\",\n \"riskCategory\":
\"Financial News\",\n \"summary\": \"Alger Spectra Fund highlights
Microsoft as a beneficiary of corporate America's digitization. Microsoft's
CEO expects technology spending as a percent of GDP to double in 10 years.
The company reported strong Q4 results but anticipates challenges in cloud
growth. CEO Nadella predicts substantial revenue from AI in 2024.\",\n \"url\":
\"https://finance.yahoo.com/news/does-microsoft-corporation-msft-high-090554924.html\"\n
\ }\n ],\n \"critical_factors\": {},\n \"earnings_summary\":
{},\n \"industry_summary\": [\n {\n \"headline\": \"German
startup Aleph Alpha raises $500M\",\n \"publishedDate\": \"2023-11-06
18:05:45\",\n \"publisher\": \"Proactive Investors\",\n \"riskCategory\":
\"Financial News\",\n \"summary\": \"Aleph Alpha, a German startup,
raised $500 million in series B funding from Bosch, SAP, and Hewlett Packard
Enterprise. The company focuses on large language models and the concept of
data sovereignty.\",\n \"url\": \"https://www.proactiveinvestors.com/companies/news/1032232/openai-s-german-rival-raises-500m-from-sap-hewlett-packard-enterprise-and-others-1032232.html\"\n
\ },\n {\n \"headline\": \"Big tech Q3 earnings showcase intense
competition\",\n \"publishedDate\": \"2023-11-06 14:03:35\",\n \"publisher\":
\"The Ticker\",\n \"riskCategory\": \"Financial News\",\n \"summary\":
\"Big tech companies Microsoft, Alphabet, and Amazon reported their Q3 earnings,
with Microsoft showcasing a 13% increase in revenue and a 29% growth in its
cloud-based business, Microsoft Azure. Google's cloud computing business grew
22%, while Amazon's cloud division, Amazon Web Services, grew 12%.\",\n \"url\":
\"https://theticker.org/12690/business/big-tech-q3-earnings-showcase-intense-competition-in-cloud-computing/\"\n
\ },\n {\n \"headline\": \"Microsoft Corporation (MSFT) Have
High Growth Potential?\",\n \"publishedDate\": \"2023-11-06 09:26:07\",\n
\ \"publisher\": \"Yahoo Finance\",\n \"riskCategory\": \"Financial
News\",\n \"summary\": \"Microsoft Corporation (NASDAQ:MSFT) is a beneficiary
of corporate America's transformative digitization. Microsoft's CEO expects
technology spending as a percent of Gross Domestic Product (GDP) to jump from
about 5% now to 10% in 10 years and that Microsoft will continue to capture
market share within the technology sector.\",\n \"url\": \"https://finance.yahoo.com/news/does-microsoft-corporation-msft-high-090554924.html\"\n
\ },\n {\n \"headline\": \"Block Inc. Posts Stellar Q3 Earnings\",\n
\ \"publishedDate\": \"2023-11-06 04:53:52\",\n \"publisher\":
\"igaming.org\",\n \"riskCategory\": \"Financial News\",\n \"summary\":
\"Block Inc., helmed by Jack Dorsey, reported impressive Q3 earnings with
net sales of $5.62 billion, a 24% increase YoY. Bitcoin sales surged to $2.42
billion, highlighting the impact of cryptocurrencies. Block aims to achieve
mid-teens gross profit growth and a mid-20% margin for adjusted operating
income by 2026. The Cash App Pay service saw a quadrupling of active monthly
users to over two million. Block authorized a $1 billion share buyback to
counteract dilution. The company's stability in the cryptocurrency market
was demonstrated by no impairment losses on its bitcoin assets in Q3 2023.\",\n
\ \"url\": \"https://igaming.org/crypto/block-inc-posts-stellar-q3-earnings-sets-ambitious-targets-for-2026/\"\n
\ },\n {\n \"headline\": \"Musk's xAI launches first AI model\",\n
\ \"publishedDate\": \"2023-11-06 01:24:18\",\n \"publisher\":
\"IT News\",\n \"riskCategory\": \"Cybersecurity News\",\n \"summary\":
\"Elon Musk's artificial intelligence startup xAI has released its first AI
model to a select group. This comes nearly a year after OpenAI's ChatGPT caught
the imagination of businesses and users around the world, spurring a surge
in adoption of generative AI technology.\",\n \"url\": \"https://www.itnews.com.au/news/musks-xai-launches-first-ai-model-to-select-group-602055\"\n
\ }\n ],\n \"metadata\": {\n \"has_industry_summary\": true,\n
\ \"is_day_after_earnings\": false,\n \"is_day_before_or_of_earnings\":
false,\n \"n_8k_articles_with_summaries\": 0,\n \"n_articles_with_summaries\":
3,\n \"n_pr_articles_with_summaries\": 0\n },\n \"pr_articles\":
[],\n \"ticker\": \"MSFT\"\n }\n]\n"
headers:
Access-Control-Allow-Origin:
- '*'
Connection:
- keep-alive
Content-Length:
- '10405'
Content-Type:
- application/json
Date:
- Wed, 08 Nov 2023 12:06:54 GMT
Server:
- nginx/1.18.0 (Ubuntu)
status:
code: 200
message: OK
version: 1

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest
from openbb_core.app.service.user_service import UserService
from openbb_ultima.models.stock_news import UltimaStockNewsFetcher
from openbb_ultima.models.company_news import UltimaCompanyNewsFetcher

test_credentials = UserService().default_user_settings.credentials.model_dump(
mode="json"
@@ -15,9 +15,9 @@ def vcr_config():


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

fetcher = UltimaStockNewsFetcher()
fetcher = UltimaCompanyNewsFetcher()
result = fetcher.test(params, credentials)
assert result is None