Skip to content

Commit

Permalink
fix bun message (#4739)
Browse files Browse the repository at this point in the history
* fix bun message

* fix units tests mocking
  • Loading branch information
Lendemor authored and masenf committed Feb 5, 2025
1 parent 69eef83 commit b6ca991
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion reflex/utils/prerequisites.py
Original file line number Diff line number Diff line change
Expand Up @@ -1293,7 +1293,7 @@ def validate_bun():
"""
bun_path = path_ops.get_bun_path()

if bun_path and bun_path.samefile(constants.Bun.DEFAULT_PATH):
if bun_path and not bun_path.samefile(constants.Bun.DEFAULT_PATH):
console.info(f"Using custom Bun path: {bun_path}")
bun_version = get_bun_version()
if not bun_version:
Expand Down
2 changes: 2 additions & 0 deletions tests/units/utils/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ def test_validate_invalid_bun_path(mocker):
mocker: Pytest mocker object.
"""
mock_path = mocker.Mock()
mock_path.samefile.return_value = False
mocker.patch("reflex.utils.path_ops.get_bun_path", return_value=mock_path)
mocker.patch("reflex.utils.prerequisites.get_bun_version", return_value=None)

Expand All @@ -138,6 +139,7 @@ def test_validate_bun_path_incompatible_version(mocker):
mocker: Pytest mocker object.
"""
mock_path = mocker.Mock()
mock_path.samefile.return_value = False
mocker.patch("reflex.utils.path_ops.get_bun_path", return_value=mock_path)
mocker.patch(
"reflex.utils.prerequisites.get_bun_version",
Expand Down

0 comments on commit b6ca991

Please sign in to comment.