diff --git a/neon_api_proxy/controller.py b/neon_api_proxy/controller.py index 7fb6688..172e4cd 100644 --- a/neon_api_proxy/controller.py +++ b/neon_api_proxy/controller.py @@ -89,8 +89,9 @@ def init_service_instances(self, service_class_mapping: dict) -> dict: api_key = self.config.get(item, {}).get("api_key") if self.config \ else None try: - if api_key is None: - LOG.warning(f"No API key for {item} in {self.config}") + if api_key is None and item != 'api_test_endpoint': + LOG.warning(f"No API key for {item} in " + f"{list(self.config.keys())}") service_mapping[item] = \ service_class_mapping[item](api_key=api_key) except Exception as e: diff --git a/neon_api_proxy/services/owm_api.py b/neon_api_proxy/services/owm_api.py index f25fa30..f93980c 100644 --- a/neon_api_proxy/services/owm_api.py +++ b/neon_api_proxy/services/owm_api.py @@ -61,7 +61,7 @@ def handle_query(self, **kwargs) -> dict: lng = kwargs.get("lng", kwargs.get("lon")) api = kwargs.get('api') or "onecall" lang = kwargs.get('lang') or "en" - units = "metric" if kwargs.get("units") == "metric" else "imperial" + units = "metric" if kwargs.get("units", kwargs.get("unit")) == "metric" else "imperial" if not all((lat, lng, units)): return {"status_code": -1, @@ -88,7 +88,7 @@ def _get_api_response(self, lat: str, lng: str, units: str, except AssertionError as e: raise ValueError(e) if api != "onecall": - log_deprecation(f"{api} was requested but only `onecall` " + log_deprecation(f"`{api}` was requested but only `onecall` " f"is supported", "1.0.0") api = "onecall" assert units in ("metric", "imperial", "standard") diff --git a/neon_api_proxy/services/wolfram_api.py b/neon_api_proxy/services/wolfram_api.py index 175c536..b0e03cf 100644 --- a/neon_api_proxy/services/wolfram_api.py +++ b/neon_api_proxy/services/wolfram_api.py @@ -92,7 +92,7 @@ def _build_query_string(**kwargs) -> str: query_params = dict() query_params['i'] = kwargs.get("query") query_params['units'] = kwargs.get("units") if \ - kwargs.get("units") == "metric" else "imperial" + kwargs.get("units", kwargs.get("unit")) == "metric" else "imperial" lat = kwargs.get("lat") lng = kwargs.get("lng") if kwargs.get("latlong"):