fix tests, maybe
This commit is contained in:
parent
6b129c5641
commit
e97c198057
@ -1054,9 +1054,7 @@ def install_bun():
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Skip if bun is already installed.
|
# Skip if bun is already installed.
|
||||||
if Path(get_config().bun_path).exists() and get_bun_version() == version.parse(
|
if get_bun_version() == version.parse(constants.Bun.VERSION):
|
||||||
constants.Bun.VERSION
|
|
||||||
):
|
|
||||||
console.debug("Skipping bun installation as it is already installed.")
|
console.debug("Skipping bun installation as it is already installed.")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -122,13 +122,13 @@ def test_validate_invalid_bun_path(mocker):
|
|||||||
Args:
|
Args:
|
||||||
mocker: Pytest mocker object.
|
mocker: Pytest mocker object.
|
||||||
"""
|
"""
|
||||||
mock = mocker.Mock()
|
mock_path = mocker.Mock()
|
||||||
mocker.patch.object(mock, "bun_path", return_value="/mock/path")
|
mocker.patch("reflex.utils.path_ops.get_bun_path", return_value=mock_path)
|
||||||
mocker.patch("reflex.utils.prerequisites.get_config", mock)
|
|
||||||
mocker.patch("reflex.utils.prerequisites.get_bun_version", return_value=None)
|
mocker.patch("reflex.utils.prerequisites.get_bun_version", return_value=None)
|
||||||
|
|
||||||
with pytest.raises(typer.Exit):
|
with pytest.raises(typer.Exit):
|
||||||
prerequisites.validate_bun()
|
prerequisites.validate_bun()
|
||||||
|
mock_path.samefile.assert_called_once()
|
||||||
|
|
||||||
|
|
||||||
def test_validate_bun_path_incompatible_version(mocker):
|
def test_validate_bun_path_incompatible_version(mocker):
|
||||||
@ -137,9 +137,9 @@ def test_validate_bun_path_incompatible_version(mocker):
|
|||||||
Args:
|
Args:
|
||||||
mocker: Pytest mocker object.
|
mocker: Pytest mocker object.
|
||||||
"""
|
"""
|
||||||
mock = mocker.Mock()
|
mocker.patch(
|
||||||
mocker.patch.object(mock, "bun_path", return_value="/mock/path")
|
"reflex.utils.path_ops.get_bun_path", return_value=constants.Bun.DEFAULT_PATH
|
||||||
mocker.patch("reflex.utils.prerequisites.get_config", mock)
|
)
|
||||||
mocker.patch(
|
mocker.patch(
|
||||||
"reflex.utils.prerequisites.get_bun_version",
|
"reflex.utils.prerequisites.get_bun_version",
|
||||||
return_value=version.parse("0.6.5"),
|
return_value=version.parse("0.6.5"),
|
||||||
|
Loading…
Reference in New Issue
Block a user