X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/1f8cf8e0244045ed2b2a8efcff5d6db967ac2b11..d9dde9439398869b39fd68c5756d89ae4f27d52c:/tests/test_html_fragments.py?ds=sidebyside diff --git a/tests/test_html_fragments.py b/tests/test_html_fragments.py index b3915fd..2d55362 100644 --- a/tests/test_html_fragments.py +++ b/tests/test_html_fragments.py @@ -1,10 +1,6 @@ -# -*- coding: utf-8 -*- -# # This file is part of Librarian, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # -from __future__ import unicode_literals - import unittest from librarian.html import extract_fragments from .utils import get_fixture @@ -17,7 +13,8 @@ class FragmentsTest(unittest.TestCase): expected_output_file_path = get_fixture('text', 'asnyk_miedzy_nami_fragments.html') closed_fragments, open_fragments = extract_fragments( - get_fixture('text', 'asnyk_miedzy_nami_expected.html')) + get_fixture('text', 'asnyk_miedzy_nami_expected.legacy.html')) assert not open_fragments - fragments_text = u"\n\n".join(u"%s: %s\n%s" % (f.id, f.themes, f) for f in sorted(closed_fragments.values(), key=lambda f: f.id)) - self.assertEqual(fragments_text, open(expected_output_file_path, 'rb').read().decode('utf-8')) + fragments_text = "\n\n".join("%s: %s\n%s" % (f.id, f.themes, f) for f in sorted(closed_fragments.values(), key=lambda f: f.id)) + with open(expected_output_file_path, 'rb') as f: + self.assertEqual(fragments_text, f.read().decode('utf-8'))