mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 20:42:26 +00:00
remove news from equity (#5741)
This commit is contained in:
@@ -887,81 +887,6 @@ def test_equity_price_historical(params, headers):
|
||||
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_equity_news(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/equity/news?{query_str}"
|
||||
result = requests.get(url, headers=headers, timeout=10)
|
||||
assert isinstance(result, requests.Response)
|
||||
assert result.status_code == 200
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"params",
|
||||
[({"symbol": "AAPL", "limit": 100, "provider": "fmp"})],
|
||||
|
||||
@@ -820,77 +820,6 @@ def test_equity_price_historical(params, obb):
|
||||
assert len(result.results) > 0
|
||||
|
||||
|
||||
@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-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_equity_news(params, obb):
|
||||
result = obb.equity.news(**params)
|
||||
assert result
|
||||
assert isinstance(result, OBBject)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"params",
|
||||
[
|
||||
|
||||
@@ -37,17 +37,6 @@ router.include_router(shorts_router)
|
||||
# pylint: disable=import-outside-toplevel, W0613:unused-argument
|
||||
|
||||
|
||||
@router.command(model="CompanyNews")
|
||||
def news(
|
||||
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())
|
||||
|
||||
|
||||
@router.command(model="EquitySearch")
|
||||
def search(
|
||||
cc: CommandContext,
|
||||
|
||||
Reference in New Issue
Block a user