Skip to content

Commit 44d6e11

Browse files
authored
fix bun message (#4739)
* fix bun message * fix units tests mocking
1 parent ef93161 commit 44d6e11

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

reflex/utils/prerequisites.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1293,7 +1293,7 @@ def validate_bun():
12931293
"""
12941294
bun_path = path_ops.get_bun_path()
12951295

1296-
if bun_path and bun_path.samefile(constants.Bun.DEFAULT_PATH):
1296+
if bun_path and not bun_path.samefile(constants.Bun.DEFAULT_PATH):
12971297
console.info(f"Using custom Bun path: {bun_path}")
12981298
bun_version = get_bun_version()
12991299
if not bun_version:

tests/units/utils/test_utils.py

+2
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ def test_validate_invalid_bun_path(mocker):
123123
mocker: Pytest mocker object.
124124
"""
125125
mock_path = mocker.Mock()
126+
mock_path.samefile.return_value = False
126127
mocker.patch("reflex.utils.path_ops.get_bun_path", return_value=mock_path)
127128
mocker.patch("reflex.utils.prerequisites.get_bun_version", return_value=None)
128129

@@ -138,6 +139,7 @@ def test_validate_bun_path_incompatible_version(mocker):
138139
mocker: Pytest mocker object.
139140
"""
140141
mock_path = mocker.Mock()
142+
mock_path.samefile.return_value = False
141143
mocker.patch("reflex.utils.path_ops.get_bun_path", return_value=mock_path)
142144
mocker.patch(
143145
"reflex.utils.prerequisites.get_bun_version",

0 commit comments

Comments
 (0)