diff --git a/CHANGELOG.md b/CHANGELOG.md index b604f17..b62b853 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,16 +2,17 @@ ## Unreleased +### Fixed + + - prevent an exception if the `log_dir` for the `OhsomeClient` was set to `None` + - removed time-dependency of unit tests that would cause them to fail at any time after the cassettes were recorded + ### Changed - relaxed dependency requirement for `urllib3` to >=2.0.2 to prevent ohsome-py from becoming a 'diamond-dependency' - improved and sped up testing (first steps towards [#139](https://github.com/GIScience/ohsome-py/issues/139)) - move metadata property from singleton to `chached_property` -### Fixed - - - removed time-dependency of unit tests that would cause them to fail at any time after the cassettes were recorded - ## 0.3.0 ### Added diff --git a/ohsome/clients.py b/ohsome/clients.py index 40ed76b..4053e33 100644 --- a/ohsome/clients.py +++ b/ohsome/clients.py @@ -56,7 +56,7 @@ def __init__( RetryError by the underlying library. """ self.log = log - self.log_dir = Path(log_dir) + self.log_dir = Path(log_dir or DEFAULT_LOG_DIR) if self.log: self.log_dir.mkdir(parents=True, exist_ok=True) if base_api_url is not None: diff --git a/ohsome/test/test_client.py b/ohsome/test/test_client.py index c0c3767..77f53bf 100644 --- a/ohsome/test/test_client.py +++ b/ohsome/test/test_client.py @@ -11,6 +11,7 @@ import pytest import ohsome +from ohsome import OhsomeClient from ohsome.constants import OHSOME_VERSION script_path = os.path.dirname(os.path.realpath(__file__)) @@ -318,3 +319,15 @@ def test_post_with_endpoint_string(base_client): assert isinstance(result, gpd.GeoDataFrame) assert len(result) == 1 + + +def test_none_init(): + """Test if the input parameters can set to None explicitly.""" + assert OhsomeClient( + base_api_url=None, + log=None, + log_dir=None, + cache=None, + user_agent=None, + retry=None, + )