Skip to content
Closed
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions src/azul/indexer/mirror_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
)
from azul.types import (
JSON,
MutableJSON,
json_element_strings,
)

Expand Down Expand Up @@ -473,6 +474,9 @@ def mirror_url(self, file: File) -> str:
file_name=file.name,
content_type=file.content_type)

def get_info(self, file: File) -> MutableJSON:
return json.loads(self._storage.get_object(self._info_object_key(file)))

def info_exists(self, file: File) -> bool:
return self._storage.object_exists(self._info_object_key(file))

Expand Down
9 changes: 9 additions & 0 deletions test/integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
from google.oauth2 import (
service_account,
)
import jsonschema
from more_itertools import (
first,
grouper,
Expand Down Expand Up @@ -1819,6 +1820,14 @@ def _delete():
self.assertIsNotNone(actual_url)
actual_url.set(args=None)
self.assertEqual(expected_url, actual_url)

with self.subTest('validate_info_schemas'):
for repository_file in indexed_files.keys():
info_object = self._mirror_service(catalog).get_info(repository_file)
schema_url = furl(info_object['$schema'])
schema = self._get_url_json('GET', schema_url)
jsonschema.validate(info_object, schema)

_delete()


Expand Down
Loading