Skip to content

Commit

Permalink
Extract variables; rename nested function
Browse files Browse the repository at this point in the history
  • Loading branch information
nadove-ucsc committed May 1, 2024
1 parent fe8cec3 commit ba1b8b0
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions test/integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1518,7 +1518,8 @@ def _test_managed_access_manifest(self,
"""
endpoint = config.service_endpoint

special_fields = self.metadata_plugin(catalog).special_fields
metadata_plugin = self.metadata_plugin(catalog)
special_fields = metadata_plugin.special_fields

def bundle_uuids(hit: JSON) -> set[str]:
return {
Expand Down Expand Up @@ -1546,7 +1547,7 @@ def bundle_uuids(hit: JSON) -> set[str]:
params = {'catalog': catalog, 'filters': json.dumps(filters)}
manifest_url = furl(url=endpoint, path='/manifest/files', args=params)

def assert_manifest(expected_bundles):
def test_compact_manifest(expected_bundles):
manifest = BytesIO(self._get_url_content(PUT, manifest_url))
manifest_rows = self._read_csv_manifest(manifest)
all_found_bundles = set()
Expand All @@ -1562,15 +1563,16 @@ def assert_manifest(expected_bundles):
all_found_bundles.update(found_bundles)
self.assertEqual(expected_bundles, all_found_bundles)

all_bundles = {public_bundle, *managed_access_bundles}
# With authorized credentials, all bundles included in the filters
# should be represented in the manifest
with self._service_account_credentials:
assert_manifest({public_bundle, *managed_access_bundles})
test_compact_manifest(all_bundles)

# Without credentials, only the public bundle should be represented
assert_manifest({public_bundle})
test_compact_manifest({public_bundle})

if ManifestFormat.curl in self.metadata_plugin(catalog).manifest_formats:
if ManifestFormat.curl in metadata_plugin.manifest_formats:
# Create a single-file curl manifest and verify that the OAuth2
# token is present on the command line
managed_access_file_id = one(self.random.choice(files)['files'])['uuid']
Expand Down

0 comments on commit ba1b8b0

Please sign in to comment.