예제 #1
0
 def test_check_for_npm_missing(self, caplog: LogCaptureFixture,
                                mocker: MockerFixture) -> None:
     """Test check_for_npm missing."""
     caplog.set_level(logging.ERROR, logger=MODULE)
     mock_which = mocker.patch(f"{MODULE}.which", return_value=False)
     with pytest.raises(NpmNotFound):
         RunwayModuleNpm.check_for_npm()
     mock_which.assert_called_once_with("npm")
     assert caplog.messages == [
         '"npm" not found in path or is not executable; please ensure it is '
         "installed correctly"
     ]
예제 #2
0
 def test_check_for_npm(self, mocker: MockerFixture) -> None:
     """Test check_for_npm."""
     mock_which = mocker.patch(f"{MODULE}.which", return_value=True)
     assert not RunwayModuleNpm.check_for_npm()
     mock_which.assert_called_once_with("npm")