def test_log_npm_command(self, mock_log, caplog, patch_module_npm, runway_context): """Test log_npm_command.""" mock_log.return_value = "success" obj = RunwayModuleNpm(context=runway_context, path="./tests", options={}) caplog.set_level(logging.DEBUG, logger="runway") assert not obj.log_npm_command(["npm", "test"]) mock_log.assert_called_once_with(["npm", "test"]) assert ["node command: success"] == caplog.messages
def test_log_npm_command(self, mock_log, caplog, patch_module_npm, runway_context): """Test log_npm_command.""" mock_log.return_value = 'success' obj = RunwayModuleNpm(context=runway_context, path='./tests', options={}) caplog.set_level(logging.INFO, logger='runway') assert not obj.log_npm_command(['npm', 'test']) mock_log.assert_called_once_with(['npm', 'test']) assert ['tests: Running "success"'] == caplog.messages