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