Skip to content

Commit

Permalink
Fix file edge case (#5033)
Browse files Browse the repository at this point in the history
* Fix file edge case

* edge case

---------

Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com>
  • Loading branch information
IgorWounds and deeleeramone authored May 16, 2023
1 parent 0f3497a commit 9beba4c
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,16 @@ def create_matching_dict() -> dict:
"screener_controller.py",
),
os.path.join(".", "openbb_terminal", "terminal_controller.py"),
os.path.join(
".", "openbb_terminal", "stocks", "comparison_analysis", "ca_controller.py"
),
]
test_paths = [
os.path.join("mutual_funds", "test_mutual_fund.openbb"),
os.path.join("stocks", "test_disc.openbb"),
os.path.join("stocks", "test_options_screen_ca.openbb"),
os.path.join("terminal", "test_news.openbb"),
os.path.join("stocks", "test_ca.openbb"),
]
return dict(zip(controller_paths, test_paths))

Expand All @@ -116,6 +120,11 @@ def match_controller_with_test(controllers: list, tests: list) -> dict:
matched[controller] = test
tests.remove(test)

for i in tests:
# Handle edge case as two controllers share the same integration test
if re.search(r"test_ca.openbb", i):
tests.remove(i)

if len(tests) > 0:
console.print(f"[red]Unmatched tests: {tests}[/red]")

Expand Down

0 comments on commit 9beba4c

Please sign in to comment.