diff --git a/gamestonk_terminal/due_diligence/financial_modeling_prep_api.py b/gamestonk_terminal/due_diligence/financial_modeling_prep_api.py index b4539ea273d..3735c122f62 100644 --- a/gamestonk_terminal/due_diligence/financial_modeling_prep_api.py +++ b/gamestonk_terminal/due_diligence/financial_modeling_prep_api.py @@ -25,6 +25,13 @@ def rating(l_args, s_ticker): print("") + except KeyError: + print( + f"Financialmodelingprep.com is returning empty responses the ticker {s_ticker}." + ) + print("") + return + except Exception as e: print(e) print("") diff --git a/tests/test_dd_financial_modeling_prep_api.py b/tests/test_dd_financial_modeling_prep_api.py new file mode 100755 index 00000000000..952cf96cb72 --- /dev/null +++ b/tests/test_dd_financial_modeling_prep_api.py @@ -0,0 +1,13 @@ +""" fundamental_analysis/business_insider_api.py tests """ +# noqa: F401 +import unittest + +# pylint: disable=unused-import +import pytest + +from gamestonk_terminal.due_diligence.financial_modeling_prep_api import rating + + +class TestDdFinancialModelingPrepApi(unittest.TestCase): + def test_rating(self): + rating([], "PLTR")