summaryrefslogtreecommitdiffstats
path: root/openbb_platform/obbject_extensions/charting/integration/test_charting_python.py
diff options
context:
space:
mode:
Diffstat (limited to 'openbb_platform/obbject_extensions/charting/integration/test_charting_python.py')
-rw-r--r--openbb_platform/obbject_extensions/charting/integration/test_charting_python.py169
1 files changed, 168 insertions, 1 deletions
diff --git a/openbb_platform/obbject_extensions/charting/integration/test_charting_python.py b/openbb_platform/obbject_extensions/charting/integration/test_charting_python.py
index 1995eabf011..9349f826e95 100644
--- a/openbb_platform/obbject_extensions/charting/integration/test_charting_python.py
+++ b/openbb_platform/obbject_extensions/charting/integration/test_charting_python.py
@@ -42,7 +42,7 @@ def get_equity_data():
[
(
{
- "provider": "fmp",
+ "provider": "yfinance",
"symbol": "AAPL",
"chart": True,
}
@@ -65,6 +65,98 @@ def test_charting_equity_price_historical(params, obb):
[
(
{
+ "provider": "yfinance",
+ "symbol": "JPYUSD",
+ "chart": True,
+ }
+ ),
+ ],
+)
+@pytest.mark.integration
+def test_charting_currency_price_historical(params, obb):
+ """Test chart currency price historical."""
+ result = obb.currency.price.historical(**params)
+ assert result
+ assert isinstance(result, OBBject)
+ assert len(result.results) > 0
+ assert result.chart.content
+ assert isinstance(result.chart.fig, OpenBBFigure)
+
+
+@parametrize(
+ "params",
+ [
+ (
+ {
+ "provider": "yfinance",
+ "symbol": "BTCUSD",
+ "chart": True,
+ }
+ ),
+ ],
+)
+@pytest.mark.integration
+def test_charting_crypto_price_historical(params, obb):
+ """Test chart crypto price historical."""
+ result = obb.crypto.price.historical(**params)
+ assert result
+ assert isinstance(result, OBBject)
+ assert len(result.results) > 0
+ assert result.chart.content
+ assert isinstance(result.chart.fig, OpenBBFigure)
+
+
+@parametrize(
+ "params",
+ [
+ (
+ {
+ "provider": "yfinance",
+ "symbol": "NDX",
+ "chart": True,
+ }
+ ),
+ ],
+)
+@pytest.mark.integration
+def test_charting_index_price_historical(params, obb):
+ """Test chart index price historical."""
+ result = obb.index.price.historical(**params)
+ assert result
+ assert isinstance(result, OBBject)
+ assert len(result.results) > 0
+ assert result.chart.content
+ assert isinstance(result.chart.fig, OpenBBFigure)
+
+
+@parametrize(
+ "params",
+ [
+ (
+ {
+ "provider": "yfinance",
+ "symbol": "QQQ",
+ "chart": True,
+ }
+ ),
+ ],
+)
+@pytest.mark.integration
+def test_charting_etf_historical(params, obb):
+ """Test chart etf historical."""
+ result = obb.etf.historical(**params)
+ assert result
+ assert isinstance(result, OBBject)
+ assert len(result.results) > 0
+ assert result.chart.content
+ assert isinstance(result.chart.fig, OpenBBFigure)
+
+
+@parametrize(
+ "params",
+ [
+ (
+ {
"data": "",
"index": "date",
"length": "60",
@@ -381,3 +473,78 @@ def test_charting_economy_fred_series(params, obb):
assert len(result.results) > 0
assert result.chart.content
assert isinstance(result.chart.fig, OpenBBFigure)
+
+
+@parametrize(
+ "params",
+ [
+ (
+ {
+ "data": None,
+ "symbol": "XRT,XLB,XLI,XLH,XLC,XLY,XLU,XLK",
+ "chart": True,
+ "provider": "finviz",
+ "chart_params": {"limit": 4, "orientation": "h"},
+ }
+ )
+ ],
+)
+@pytest.mark.integration
+def test_charting_equity_price_performance(params, obb):
+ """Test chart equity price performance."""
+ result = obb.equity.price.performance(**params)
+ assert result
+ assert isinstance(result, OBBject)
+ assert len(result.results) > 0
+ assert result.chart.content
+ assert isinstance(result.chart.fig, OpenBBFigure)
+
+
+@parametrize(
+ "params",
+ [
+ (
+ {
+ "data": None,
+ "symbol": "XRT,XLB,XLI,XLH,XLC,XLY,XLU,XLK",
+ "chart": True,
+ "provider": "intrinio",
+ "chart_params": {"orientation": "v"},
+ }
+ )
+ ],
+)
+@pytest.mark.integration
+def test_charting_etf_price_performance(params, obb):
+ """Test chart etf price performance."""
+ result = obb.etf.price_performance(**params)
+ assert result
+ assert isinstance(result, OBBject)
+ assert len(result.results) > 0
+ assert result.chart.content
+ assert isinstance(result.chart.fig, OpenBBFigure)
+
+
+@parametrize(
+ "params",
+ [
+ (
+ {
+ "data": None,
+ "symbol": "XRT",
+ "chart": True,
+ "provider": "fmp",
+ "chart_params": {"orientation": "v", "limit": 10},
+ }
+ )
+ ],
+)
+@pytest.mark.integration
+def test_charting_etf_holdings(params, obb):
+ """Test chart etf holdings."""
+ result = obb.etf.holdings(**params)
+ assert result
+ assert isinstance(result, OBBject)
+ assert len(result.results) > 0
+ assert result.chart.content
+ assert isinstance(result.chart.fig, OpenBBFigure)