mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-05 00:42:19 +00:00
* quick econ fix * black * keys and feature flags * terminal name 👀 * some more replacements * some more replacements * edit pyproject * gst -> openbb * add example portfolios back to git * Update api from gst * sorry. skipping some tests * another round of names * another round of test edits * Missed some .gst refs and update timezone * water mark stuff * Fixing Names in terminal.spec and name of GTFF_DEFAULTS to OBBFF_DEFAULTS * Add statsmodels and linearmodels datasets to bundle * Update openbb test scripts to exit after they're done * Fix default export path for packaged apps * Update packaging settings after rename * Exclude jupyter and report from packaged apps and testing * Fix typo * Remove divcal from test because it freezes the terminal * Add openbb mac icon * Add windows icon and splashscreen * Fix markdown linting * Fix gov & economy failed test (#1585) * fix more GST to OpenBB Terminal * Fix gov & economy fail tests * Small changes * Patching valuation & performance command * Change GTFF to OBBFF Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt> Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> * Resolve no-else and inconsistent return * Set default predict to true * Fix multiple bugs: Add ylabels to bt menu & Fix reports bug (#1581) * Add y labels to all bt commands * Fix reports bug * Update crypto market * Update crypto market * Remove gst folders and remaining files Co-authored-by: didierlopes.eth <dro.lopes@campus.fct.unl.pt> * Break CI * Break CI again * Fix small rsi bug (#1588) * Add y labels to all bt commands * Fix reports bug * Update crypto market * Update crypto market * Remove gst folders and remaining files * Add back crypto market * Update report controller * Remove bt view from gst Co-authored-by: didierlopes.eth <dro.lopes@campus.fct.unl.pt> * Clean up remainder of Gamestonk * Fix CI back * Force CI to install pytest * Tests : fix test_menu * Fix loggers linting * Rename default OPENBB feature flags * Rename defaults feature flag file * Loggers : fix mypy * OBBFF to OPENBB in terminal.spec * Change flair to butterfly * Force CI to create a new cache * Force CI to create a new cache in conda tests * Skip test * Clear other caches * Fix linting Co-authored-by: james <jmaslek11@gmail.com> Co-authored-by: Andrew <andrew.kenreich@gmail.com> Co-authored-by: minhhoang1023 <40023817+minhhoang1023@users.noreply.github.com> Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt> Co-authored-by: Chavithra PARANA <chavithra@gmail.com>
60 lines
1.6 KiB
Python
60 lines
1.6 KiB
Python
# IMPORTATION STANDARD
|
|
|
|
# IMPORTATION THIRDPARTY
|
|
import pandas as pd
|
|
import pytest
|
|
|
|
# IMPORTATION INTERNAL
|
|
from openbb_terminal.common.behavioural_analysis import finbrain_view
|
|
from openbb_terminal import helper_funcs
|
|
|
|
|
|
@pytest.mark.default_cassette("test_display_sentiment_analysis")
|
|
@pytest.mark.vcr
|
|
@pytest.mark.record_stdout
|
|
@pytest.mark.parametrize("color", [True, False])
|
|
def test_display_sentiment_analysis(color, mocker):
|
|
# MOCK EXPORT_DATA
|
|
mocker.patch(
|
|
target="openbb_terminal.common.behavioural_analysis.finbrain_view.export_data"
|
|
)
|
|
|
|
# MOCK OBBFF
|
|
mocker.patch.object(target=helper_funcs.obbff, attribute="USE_ION", new=True)
|
|
mocker.patch.object(
|
|
target=finbrain_view.rich_config, attribute="USE_COLOR", new=color
|
|
)
|
|
|
|
# MOCK VISUALIZE_OUTPUT
|
|
mocker.patch(target="openbb_terminal.helper_classes.TerminalStyle.visualize_output")
|
|
|
|
finbrain_view.display_sentiment_analysis(
|
|
ticker="AAPL",
|
|
export="",
|
|
)
|
|
|
|
|
|
@pytest.mark.vcr(record_mode="none")
|
|
@pytest.mark.record_stdout
|
|
def test_display_sentiment_analysis_empty_df(mocker):
|
|
view = "openbb_terminal.common.behavioural_analysis.finbrain_view"
|
|
|
|
# MOCK EXPORT_DATA
|
|
mocker.patch(
|
|
target="openbb_terminal.common.behavioural_analysis.finbrain_view.export_data"
|
|
)
|
|
|
|
# MOCK OBBFF
|
|
mocker.patch.object(target=helper_funcs.obbff, attribute="USE_ION", new=True)
|
|
|
|
# MOCK GET_SENTIMENT
|
|
mocker.patch(
|
|
target=f"{view}.finbrain_model.get_sentiment",
|
|
return_value=pd.DataFrame(),
|
|
)
|
|
|
|
finbrain_view.display_sentiment_analysis(
|
|
ticker="AAPL",
|
|
export="",
|
|
)
|