Files
OpenBB/tests/openbb_terminal/test_sdk.py
Chavithra b93671ad0b SDK : faster and simpler architecture (#3289)
* SDK : split features

* Fix linting

* SDK : remove functions

* SDK : update openbb object building

* SDK : comments

* Typing

* Typing

* Typing

* SDK : update logs

* SDK : Breadcrumb

* SDK : Breadcrumb + Operation

* SDK : spell

* Linting

* Tests : SDK

* SDK : Operation

* SDK : Operation

* Linting

* enable wrong import position

* added logging info

* added log supression

* reverted the order

* SDK : update trail_map

* log suppresion as configuration

* changes reports to use the new sdk

* changes dashboards to use the new sdk

* changes dashboards to use the new sdk

* updated the documentation

* Tests + Linting

* Replace old sdk by new sdk

* Linting

* SDK : import + map_dict

* Linting

* Linting

* SDK : sdk + trail_map

* Linting

* SDK : forecasting

* SDK : update import path

* SDK

* SDK : md

* Linting

* removed unused functions

* trunc args to a max of 100 characters

* added logging when exceptions

* .md files

* SDK : add signature on operation + linting + remove trail on Breadcrumb

* Linting

* Move tests

* Linting

* Linting

* Linting

* Linting

* Linting

* Linting

* Linting

Co-authored-by: Henrique Joaquim <h.joaquim@campus.fct.unl.pt>
2022-11-09 22:25:12 +01:00

30 lines
773 B
Python

from importlib import import_module
from typing import Callable
from openbb_terminal.sdk import trail_map
def __get_method(method_path: str) -> Callable:
module_path, function_name = method_path.rsplit(".", 1)
module = import_module(module_path)
method = getattr(module, function_name)
return method
def test_load_models():
map_dict = trail_map.map_dict
for trail in map_dict:
if "model" in map_dict[trail]:
method_path = map_dict[trail]["model"]
__get_method(method_path=method_path)
def test_load_views():
map_dict = trail_map.map_dict
for trail in map_dict:
if "view" in map_dict[trail]:
method_path = map_dict[trail]["model"]
__get_method(method_path=method_path)