Support cover logo.
[librarian.git] / tests / test_fb2.py
1 # This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Wolne Lektury. See NOTICE for more information.
3 #
4 from unittest import TestCase
5 from librarian import NoDublinCore
6 from librarian.parser import WLDocument
7 from .utils import get_fixture
8
9
10 class FB2Tests(TestCase):
11     maxDiff = None
12
13     def test_transform(self):
14         expected_output_file_path = get_fixture('text', 'asnyk_miedzy_nami_expected.fb2')
15
16         text = WLDocument.from_file(
17             get_fixture('text', 'miedzy-nami-nic-nie-bylo.xml')
18         ).as_fb2().get_bytes().decode('utf-8')
19
20         with open(expected_output_file_path, 'rb') as f:
21             self.assertEqual(text, f.read().decode('utf-8'))
22