OWSLib icon indicating copy to clipboard operation
OWSLib copied to clipboard

clean up code in WFS classes

Open 640kb opened this issue 2 years ago • 3 comments

Code cleaned up and simplified. The manual call of the init function is not necessary. Until now, the function is called twice.

640kb avatar Oct 11 '23 10:10 640kb

2023-10-11T10:22:58.9093231Z =================================== FAILURES ===================================
2023-10-11T10:22:58.9094249Z [31m[1m__________________________ test_ogcapi_records_pycsw ___________________________[0m
2023-10-11T10:22:58.9094776Z Traceback (most recent call last):
2023-10-11T10:22:58.9110680Z   File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/_pytest/runner.py", line 341, in from_call
2023-10-11T10:22:58.9111818Z     result: Optional[TResult] = func()
2023-10-11T10:22:58.9112802Z   File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/_pytest/runner.py", line 262, in <lambda>
2023-10-11T10:22:58.9113553Z     lambda: ihook(item=item, **kwds), when=when, reraise=reraise
2023-10-11T10:22:58.9114337Z   File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/pluggy/_hooks.py", line 493, in __call__
2023-10-11T10:22:58.9114947Z     return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
2023-10-11T10:22:58.9115767Z   File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/pluggy/_manager.py", line 115, in _hookexec
2023-10-11T10:22:58.9116391Z     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
2023-10-11T10:22:58.9117190Z   File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/pluggy/_callers.py", line 152, in _multicall
2023-10-11T10:22:58.9117762Z     return outcome.get_result()
2023-10-11T10:22:58.9118488Z   File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/pluggy/_result.py", line 114, in get_result
2023-10-11T10:22:58.9119071Z     raise exc.with_traceback(exc.__traceback__)
2023-10-11T10:22:58.9119823Z   File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/pluggy/_callers.py", line 77, in _multicall
2023-10-11T10:22:58.9121923Z     res = hook_impl.function(*args)
2023-10-11T10:22:58.9122623Z   File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/_pytest/runner.py", line 177, in pytest_runtest_call
2023-10-11T10:22:58.9123037Z     raise e
2023-10-11T10:22:58.9123714Z   File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/_pytest/runner.py", line 169, in pytest_runtest_call
2023-10-11T10:22:58.9124136Z     item.runtest()
2023-10-11T10:22:58.9125046Z   File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/_pytest/python.py", line 1792, in runtest
2023-10-11T10:22:58.9125718Z     self.ihook.pytest_pyfunc_call(pyfuncitem=self)
2023-10-11T10:22:58.9126549Z   File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/pluggy/_hooks.py", line 493, in __call__
2023-10-11T10:22:58.9127066Z     return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
2023-10-11T10:22:58.9127772Z   File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/pluggy/_manager.py", line 115, in _hookexec
2023-10-11T10:22:58.9128262Z     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
2023-10-11T10:22:58.9128950Z   File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/pluggy/_callers.py", line 113, in _multicall
2023-10-11T10:22:58.9129484Z     raise exception.with_traceback(exception.__traceback__)
2023-10-11T10:22:58.9130197Z   File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/pluggy/_callers.py", line 77, in _multicall
2023-10-11T10:22:58.9130625Z     res = hook_impl.function(*args)
2023-10-11T10:22:58.9131276Z   File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/_pytest/python.py", line 194, in pytest_pyfunc_call
2023-10-11T10:22:58.9131731Z     result = testfunction(**testargs)
2023-10-11T10:22:58.9132216Z   File "/home/runner/work/OWSLib/OWSLib/tests/test_ogcapi_records_pycsw.py", line 26, in test_ogcapi_records_pycsw
2023-10-11T10:22:58.9132754Z     assert len(conformance['conformsTo']) == 18
2023-10-11T10:22:58.9133070Z AssertionError: assert 14 == 18
2023-10-11T10:22:58.9134810Z  +  where 14 = len(['http://www.opengis.net/spec/ogcapi-common-1/1.0/conf/core', 'http://www.opengis.net/spec/ogcapi-common-2/1.0/conf/collections', 'http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/core', 'http://www.opengis.net/spec/ogcapi-features-3/1.0/conf/queryables', 'http://www.opengis.net/spec/ogcapi-features-3/1.0/conf/queryables-query-parameters', 'http://www.opengis.net/spec/ogcapi-features-3/1.0/conf/filter', ...])
2023-10-11T10:22:58.9136083Z [33m=============================== warnings summary ===============================[0m

Is the test test_ogcapi_records_pycsw up to date?

The website https://demo.pycsw.org/cite/conformance has only 14 entries.

640kb avatar Oct 11 '23 13:10 640kb

Coverage Status

coverage: 58.748% (-0.5%) from 59.265% when pulling 7d416149a0bcc76ab3b166485af9df48328fac0f on 640kb:master into 59ab2c3b6ab3ce44376bd51cff8f2be7cb64228a on geopython:master.

coveralls avatar Oct 12 '23 09:10 coveralls

I have updated the test.

In the commit https://github.com/geopython/pycsw/commit/e1abe9bc9de68f5c25061be031269752a79d384e the number of entries for "conformance" and "queryables" have changed.

640kb avatar Oct 12 '23 09:10 640kb