FreedomBox/freedombox/modules/kiwix/tests/test_validations.py
Sunil Mohan Adapa baa44e91a2
*: Update imports statements from plinth to freedombox
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2026-08-28 07:35:18 -04:00

21 lines
575 B
Python

# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Test module for Kiwix validations.
"""
import pytest
from freedombox.modules import kiwix
def test_add_file_with_invalid_extension():
"""Test that adding a file with invalid fails as expected."""
with pytest.raises(ValueError):
kiwix.validate_file_name('wikipedia.zip')
# We don't support the legacy format of split zim files.
with pytest.raises(ValueError):
kiwix.validate_file_name('wikipedia_en_all_maxi_2022-05.zima')
kiwix.validate_file_name('wikipedia_en_all_maxi_2022-05.zim')