From 9a067ca2ca3efe8243fee4d46a5dba24d3d16a3b Mon Sep 17 00:00:00 2001 From: test-codeop <78349281+test-codeop@users.noreply.github.com> Date: Wed, 21 Oct 2026 10:29:35 +0100 Subject: [PATCH 1/2] Replay added lines from example PR --- .uncover-agent/added.py | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .uncover-agent/added.py diff --git a/.uncover-agent/added.py b/.uncover-agent/added.py new file mode 100644 index 000000000..fde7ef0ff --- /dev/null +++ b/.uncover-agent/added.py @@ -0,0 +1,40 @@ + if v.get('visibility', 'default') == 'hidden' \ + and dataset is None: +@pytest.fixture() +def config_exclusively_hidden_resources(): + filename = 'pygeoapi-test-config-exclusively-hidden-resources.yml' + with open(get_test_file_path(filename)) as fh: + return yaml_load(fh) + + +@pytest.fixture() +def api_exclusively_hidden_resources(config_exclusively_hidden_resources, openapi): # noqa + '''Returns an API instance where all resources are marked as hidden''' + return API(config_exclusively_hidden_resources, openapi) + + +def test_describe_collections_with_only_hidden_resources( + api_exclusively_hidden_resources +): + ''' + Test an API with only hidden resources to ensure + there are no indexing errors when no collections are returned + ''' + req = mock_api_request({}) + _, code, response = describe_collections(api_exclusively_hidden_resources, req) # noqa + assert code == HTTPStatus.OK + + collections = json.loads(response) + assert len(collections['collections']) == 0, \ + 'All collections are hidden so there should be none in the response' + + hidden_collection_name = 'objects' + _, code, response = describe_collections( + api_exclusively_hidden_resources, req, hidden_collection_name + ) + + assert code == HTTPStatus.OK + collection = json.loads(response) + assert collection['title'] == 'GeoJSON objects', \ + 'The collection should have its normal title even if hidden' + From 5189c3d23dbe152ec460fc23e500397f1aa5b2c9 Mon Sep 17 00:00:00 2001 From: test-codeop <78349281+test-codeop@users.noreply.github.com> Date: Wed, 21 Oct 2026 10:29:36 +0100 Subject: [PATCH 2/2] uncover-agent: test diff marker --- .uncover-agent/NOTE.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .uncover-agent/NOTE.txt diff --git a/.uncover-agent/NOTE.txt b/.uncover-agent/NOTE.txt new file mode 100644 index 000000000..bc4d88d93 --- /dev/null +++ b/.uncover-agent/NOTE.txt @@ -0,0 +1,3 @@ +# uncover-agent test diff +# original: https://github.com/geopython/pygeoapi/pull/2330 +# generated 2026-10-21 09:29:36 UTC