tests.djvu_tests module#

Unit tests for tools.djvu.py.

class tests.djvu_tests.TestDjVuFile(*args, **kwargs)[source]#

Bases: DisableSiteMixin, TestCase

Test DjVuFile class.

abstract_class = False#
file_djvu_wo_text = '/src/tests/data/djvu/myfile_wo_text.djvu'#
classmethod setUpClass()[source]#

Skip if djvulibre library not installed.

test_clear_cache()[source]#

Test if djvu file contains text.

test_delete_not_existing_page_number()[source]#

Test djvu page cannot be deleted if page number is out of range.

test_get_existing_page_number()[source]#

Test text is returned for existing page number.

test_get_most_common_info()[source]#

Test that most common (size, dpi) are returned.

test_get_not_existing_page()[source]#

Test error is raised if djvu file has no text.

test_get_not_existing_page_number()[source]#

Test error is raised if djvu page number is out of range.

test_has_text()[source]#

Test if djvu file contains text.

test_number_of_images()[source]#

Test page number generator.

test_page_info()[source]#

Test page info retrieval.

test_txt = 'A file with non-ASCII characters, \nlike é or ç'#
test_whiten_not_existing_page_number()[source]#

Test djvu page cannot be whitend if page number is out of range.

class tests.djvu_tests.TestDjVuFileWithoutLib(*args, **kwargs)[source]#

Bases: DisableSiteMixin, TestCase

Test DjVuFile class without library installed.

abstract_class = False#
file_djvu_not_existing = '/src/tests/data/djvu/not_existing.djvu'#
test_file_existence()[source]#

Test file existence checks.

test_repr_method()[source]#

Test __repr__() method.

test_str_method()[source]#

Test __str__() method.