From b6ca991cc3d57ddb8606ee49bd7acea413a71f50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Tue, 4 Feb 2025 01:05:47 +0100 Subject: [PATCH] fix bun message (#4739) * fix bun message * fix units tests mocking --- reflex/utils/prerequisites.py | 2 +- tests/units/utils/test_utils.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/reflex/utils/prerequisites.py b/reflex/utils/prerequisites.py index 629198185d3..099ccaf69b4 100644 --- a/reflex/utils/prerequisites.py +++ b/reflex/utils/prerequisites.py @@ -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: diff --git a/tests/units/utils/test_utils.py b/tests/units/utils/test_utils.py index 44356dac5e2..7cd53f14ac8 100644 --- a/tests/units/utils/test_utils.py +++ b/tests/units/utils/test_utils.py @@ -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) @@ -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",