|
@@ -115,7 +115,20 @@ def test_typehint_issubclass(subclass, superclass, expected):
|
|
|
assert types.typehint_issubclass(subclass, superclass) == expected
|
|
|
|
|
|
|
|
|
-def test_validate_invalid_bun_path(mocker):
|
|
|
+def test_validate_none_bun_path(mocker):
|
|
|
+ """Test that an error is thrown when a bun path is not specified.
|
|
|
+
|
|
|
+ Args:
|
|
|
+ mocker: Pytest mocker object.
|
|
|
+ """
|
|
|
+ mocker.patch("reflex.utils.path_ops.get_bun_path", return_value=None)
|
|
|
+ # with pytest.raises(typer.Exit):
|
|
|
+ prerequisites.validate_bun()
|
|
|
+
|
|
|
+
|
|
|
+def test_validate_invalid_bun_path(
|
|
|
+ mocker,
|
|
|
+):
|
|
|
"""Test that an error is thrown when a custom specified bun path is not valid
|
|
|
or does not exist.
|
|
|
|
|
@@ -123,13 +136,12 @@ 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.path_ops.samefile", return_value=False)
|
|
|
mocker.patch("reflex.utils.prerequisites.get_bun_version", return_value=None)
|
|
|
|
|
|
with pytest.raises(typer.Exit):
|
|
|
prerequisites.validate_bun()
|
|
|
- mock_path.samefile.assert_called_once()
|
|
|
|
|
|
|
|
|
def test_validate_bun_path_incompatible_version(mocker):
|
|
@@ -141,6 +153,7 @@ def test_validate_bun_path_incompatible_version(mocker):
|
|
|
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.path_ops.samefile", return_value=False)
|
|
|
mocker.patch(
|
|
|
"reflex.utils.prerequisites.get_bun_version",
|
|
|
return_value=version.parse("0.6.5"),
|