From 65818683c2c9a7477fe7dd5569ebf3ad73f7217b Mon Sep 17 00:00:00 2001 From: Colin Delahunty <72827203+colin99d@users.noreply.github.com> Date: Wed, 15 Mar 2023 16:33:35 -0400 Subject: [PATCH] Hotfix/fred (#4493) * Updated reqs * Updated reqs * Fix test --------- Co-authored-by: teh_coderer Co-authored-by: James Maslek --- openbb_terminal/economy/economy_controller.py | 8 ++++++++ tests/openbb_terminal/economy/test_economy_controller.py | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/openbb_terminal/economy/economy_controller.py b/openbb_terminal/economy/economy_controller.py index cc325d3545a..533cecdd0e0 100644 --- a/openbb_terminal/economy/economy_controller.py +++ b/openbb_terminal/economy/economy_controller.py @@ -679,6 +679,10 @@ class EconomyController(BaseController): dest="parameter", default="", help="Series ID of the Macro Economic data from FRED", + required="-h" not in other_args + and "--help" not in other_args + and "-q" not in other_args + and "--query" not in other_args, ) parser.add_argument( "-s", @@ -704,6 +708,10 @@ class EconomyController(BaseController): nargs="+", dest="query", help="Query the FRED database to obtain Series IDs given the query search term.", + required="-h" not in other_args + and "--help" not in other_args + and "-p" not in other_args + and "--parameter" not in other_args, ) if other_args and "-" not in other_args[0][0]: other_args.insert(0, "-p") diff --git a/tests/openbb_terminal/economy/test_economy_controller.py b/tests/openbb_terminal/economy/test_economy_controller.py index 1089fc01ee3..930d8734bbd 100644 --- a/tests/openbb_terminal/economy/test_economy_controller.py +++ b/tests/openbb_terminal/economy/test_economy_controller.py @@ -835,7 +835,7 @@ def test_call_fred_query(mocker): "other_args, mocked_func, called_args, called_kwargs", [ ( - ["--parameter=dgs2,dgs5"], + ["--parameter", "dgs2,dgs5"], "fred_view.display_fred_series", [], dict( @@ -850,7 +850,7 @@ def test_call_fred_query(mocker): ), ), ( - ["--parameter=DgS2,dgs5", "--export=csv", "--raw"], + ["--parameter", "DgS2,dgs5", "--export=csv", "--raw"], "fred_view.display_fred_series", [], dict( @@ -865,7 +865,7 @@ def test_call_fred_query(mocker): ), ), ( - ["--parameter=DgS2,dgs5", "--export=csv", "--start=2022-10-10"], + ["--parameter", "DgS2,dgs5", "--export=csv", "--start=2022-10-10"], "fred_view.display_fred_series", [], dict(