1 # -*- coding: utf-8 -*-
3 # This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
4 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
6 from __future__ import unicode_literals
8 from zipfile import ZipFile
10 from nose.tools import *
11 from librarian import DirDocProvider
12 from librarian.parser import WLDocument
13 from tests.utils import get_fixture
17 epub = WLDocument.from_file(
18 get_fixture('text', 'asnyk_zbior.xml'),
19 provider=DirDocProvider(get_fixture('text', ''))
20 ).as_epub(flags=['without_fonts']).get_file()
23 # Check contributor list.
24 last = zipf.open('OPS/last.html')
25 tree = html.parse(last)
26 editors_attribution = False
27 for par in tree.findall("//p"):
28 if par.text.startswith(u'Opracowanie redakcyjne i przypisy:'):
29 editors_attribution = True
32 u'Opracowanie redakcyjne i przypisy: '
33 u'Adam Fikcyjny, Aleksandra Sekuła, Olga Sutkowska.')
34 assert_true(editors_attribution)
37 def test_transform_hyphenate():
38 epub = WLDocument.from_file(
39 get_fixture('text', 'asnyk_zbior.xml'),
40 provider=DirDocProvider(get_fixture('text', ''))
42 flags=['without_fonts'],