Skip to content

Commit

Permalink
feat: Increase account dir search depth (#285)
Browse files Browse the repository at this point in the history
  • Loading branch information
angelofenoglio authored Sep 17, 2024
1 parent a382f59 commit 287847b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions leverage/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ def get_account_path():
cur_path = Path(get_working_path())
prev_path = cur_path

# NOTE: currently we only support up to 5 subdir levels. Normally we use
# NOTE: currently we only support up to 8 subdir levels. Normally we use
# only 2 subdirectories so this should be enough for most cases.
for _ in range(5):
for _ in range(8):
if cur_path.resolve() == root_path:
break

Expand Down
2 changes: 1 addition & 1 deletion tests/test_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def test_get_root_path():
def test_get_account_path(monkeypatch, tmp_path):
# Make a deep directory structure
root_dir = leaf_dir = tmp_path
leaf_dir = leaf_dir / "subdir" / "subdir" / "subdir" / "subdir"
leaf_dir = leaf_dir / "subdir" / "subdir" / "subdir" / "subdir" / "subdir" / "subdir" / "subdir"
leaf_dir.mkdir(parents=True)

monkeypatch.setattr(lepath, "get_root_path", lambda: root_dir)
Expand Down

0 comments on commit 287847b

Please sign in to comment.