X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/4e329824f40367945de11d3647396859092f5c2c..bd97f61d25eb0c3e51a29286c7de509146eceb37:/tests/test_html_fragments.py?ds=sidebyside diff --git a/tests/test_html_fragments.py b/tests/test_html_fragments.py index 16057bc..5c89d68 100644 --- a/tests/test_html_fragments.py +++ b/tests/test_html_fragments.py @@ -5,16 +5,19 @@ # from __future__ import unicode_literals +import unittest from librarian.html import extract_fragments -from nose.tools import * from .utils import get_fixture -def test_fragments(): - expected_output_file_path = get_fixture('text', 'asnyk_miedzy_nami_fragments.html') +class FragmentsTest(unittest.TestCase): + maxDiff = None - closed_fragments, open_fragments = extract_fragments( - get_fixture('text', 'asnyk_miedzy_nami_expected.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)) - assert_equal(fragments_text, open(expected_output_file_path, 'rb').read().decode('utf-8')) + def test_fragments(self): + 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.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'))