Skip to content

Commit

Permalink
Tests with Bernhard
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderWatzinger committed Nov 3, 2023
1 parent 22fad90 commit 42e08d8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions openatlas/api/endpoints/display_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ def get() -> tuple[Any, int]:
if license_ := get_license_name(entity):
if path := get_file_path(entity):
iiif_manifest = ''
if check_iiif_activation() \
and check_iiif_file_exist(entity.id):
if (check_iiif_activation() and
check_iiif_file_exist(entity.id)):
iiif_manifest = url_for(
'api.iiif_manifest',
version=g.settings['iiif']['version'],
id_=entity.id,
_external=True)
_external=True) # pragma: no cover
files_dict[path.stem] = {
'extension': path.suffix,
'display': url_for(
Expand Down
2 changes: 1 addition & 1 deletion openatlas/api/formats/loud.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def get_domain_links() -> dict[str, Any]:
id_ = link_.domain.id
suffix = g.files[id_].suffix.replace('.', '')
if not app.config['IMAGE_FORMATS'].get(suffix):
continue
continue # pragma: no cover
image = {
"id": url_for('api.entity', id_=id_, _external=True),
"_label": link_.domain.name,
Expand Down
2 changes: 1 addition & 1 deletion openatlas/display/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ def check_iiif_activation() -> bool:
def check_iiif_file_exist(id_: int) -> bool:
if g.settings['iiif_conversion']:
return get_iiif_file_path(id_).is_file()
return bool(get_file_path(id_))
return bool(get_file_path(id_)) # pragma: no cover


def get_iiif_file_path(id_: int) -> Path:
Expand Down
2 changes: 1 addition & 1 deletion tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def setup_database(self) -> None:
Path(app.root_path).parent / 'install' /
f'{file_name}.sql', encoding='utf8') as sql_file:
self.cursor.execute(sql_file.read())
if app.config['LOAD_WINDOWS_TEST_SQL']:
if app.config['LOAD_WINDOWS_TEST_SQL']: # pragma: no cover
with open(
Path(app.root_path).parent / 'install' /
f'data_test_windows.sql', encoding='utf8') as sql_file:
Expand Down

0 comments on commit 42e08d8

Please sign in to comment.