def test__ensure_storm_path_in_configs_path_not_found(self, mock_search): mock_configs = mock.Mock(specs=["storm_cmd_path"]) mock_configs.storm_cmd_path = None mock_search.return_value = None with pytest.raises(ConfigurationError): subcommand._ensure_storm_path_in_configs(mock_configs) mock_search.assert_called_with()
def test__ensure_storm_path_in_configs_path_not_found(self, mock_search): mock_configs = mock.Mock(specs=['storm_cmd_path']) mock_configs.storm_cmd_path = None mock_search.return_value = None with pytest.raises(ConfigurationError): subcommand._ensure_storm_path_in_configs(mock_configs) mock_search.assert_called_with()
def test__ensure_storm_path_in_configs_path_defined(self, mock_update, mock_search): mock_configs = mock.Mock(specs=["storm_cmd_path"]) configs = subcommand._ensure_storm_path_in_configs(mock_configs) assert mock_search.called == 0 assert mock_update.called == 0 assert configs == mock_configs
def test__ensure_storm_path_in_configs_path_not_defined(self, mock_update, mock_search): mock_configs = mock.Mock(specs=["storm_cmd_path"]) mock_configs.storm_cmd_path = None configs = subcommand._ensure_storm_path_in_configs(mock_configs) mock_search.assert_called_with() mock_update.assert_called_with(mock_configs, {"storm_cmd_path": mock_search.return_value}) assert configs == mock_update.return_value
def test__ensure_storm_path_in_configs_path_defined( self, mock_update, mock_search): mock_configs = mock.Mock(specs=['storm_cmd_path']) configs = subcommand._ensure_storm_path_in_configs(mock_configs) assert mock_search.called == 0 assert mock_update.called == 0 assert configs == mock_configs
def test__ensure_storm_path_in_configs_path_not_defined( self, mock_update, mock_search): mock_configs = mock.Mock(specs=['storm_cmd_path']) mock_configs.storm_cmd_path = None configs = subcommand._ensure_storm_path_in_configs(mock_configs) mock_search.assert_called_with() mock_update.assert_called_with( mock_configs, {'storm_cmd_path': mock_search.return_value}) assert configs == mock_update.return_value