Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PB-224: Added unit test to test new provider filtering functionality #474

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions app/tests/tests_10/test_collections_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,26 @@ def test_single_collection_endpoint(self):

self.check_stac_collection(self.collection_1.json, response_json)

def test_filtering_by_provider(self):
collection_with_provider = self.factory.create_sample(
sample='collection-1',
name='collection-provider',
providers=[{
'name': 'test-provider'
}],
db_create=True
)

response = self.client.get(f"/{STAC_BASE_V}/collections?provider=test-provider")
response_json = response.json()
self.assertStatusCode(200, response)

self.assertEqual(
len(response_json['collections']),
1,
msg=f"Only one collection should be returned. Response: {response_json}"
)

@mock_s3_asset_file
def test_single_collection_assets_endpoint(self):
asset_count = 3
Expand Down