mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-06 09:22:26 +00:00
* Allow to set variables and do loops * Fix mypy errors * improve code * mypy * pylint * accepts Openbb date keywords like 1MONTHAGO,LASTFRIDAY,3YEARSFROMNOW,NEXTTUESDAY * warn fix * add documentation for script foreach and vars creation * refactor controller as per James request * black linting * add another warning * Editing some routine enhancements (#5063) * move routine to new file * Move to relativedelta and add some tests * Fix mocking * Get match_and_return_openbb_keyword_date to 100% cov * start testing parse script * remove rogue prints --------- Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt> * big improvement in routines tests * mypy lint * ruff lint * lint * typo * test relative time * cover edge case of home at end of script * fix edge case for going to home at start * explain better slicing * foreach tests added * lint * allow foreach loops to have different var names that is iterating * foreach more powerful * warning when var in foreach is not used * fail script when varname that iterates foreach loop is never defined * black * lint again * ruff * improve another edge case * fix test and fix a description * fix nft test and routine test * why mutual fund test failing --------- Co-authored-by: James Maslek <jmaslek11@gmail.com>
20 lines
514 B
Python
20 lines
514 B
Python
# IMPORTATION STANDARD
|
|
|
|
# IMPORTATION THIRDPARTY
|
|
import pytest
|
|
from freezegun import freeze_time
|
|
|
|
# IMPORTATION INTERNAL
|
|
from openbb_terminal.common.ultima_newsmonitor_view import display_news
|
|
|
|
|
|
@pytest.mark.vcr
|
|
@pytest.mark.record_stdout
|
|
@pytest.mark.parametrize("term", ["", "AAPL", "TSLA", "FCX", "asdf&%$"])
|
|
@freeze_time("2023-05-30")
|
|
def test_display_news(term, mocker):
|
|
# MOCK EXPORT_DATA
|
|
mocker.patch(target="openbb_terminal.common.ultima_newsmonitor_view.export_data")
|
|
|
|
display_news(term=term)
|