X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/4e329824f40367945de11d3647396859092f5c2c..0604bdd5f693da9f1c78f9d9fa2276f0c7b6c17b:/tests/test_html.py?ds=sidebyside diff --git a/tests/test_html.py b/tests/test_html.py index d77d8fe..7846376 100644 --- a/tests/test_html.py +++ b/tests/test_html.py @@ -5,20 +5,25 @@ # from __future__ import unicode_literals +import io +from unittest import TestCase from librarian import NoDublinCore from librarian.parser import WLDocument from nose.tools import * from .utils import get_fixture -def test_transform(): - expected_output_file_path = get_fixture('text', 'asnyk_miedzy_nami_expected.html') +class TransformTest(TestCase): + maxDiff = None - html = WLDocument.from_file( + def test_transform(self): + expected_output_file_path = get_fixture('text', 'asnyk_miedzy_nami_expected.html') + + html = WLDocument.from_file( get_fixture('text', 'miedzy-nami-nic-nie-bylo.xml') - ).as_html().get_bytes() + ).as_html().get_bytes().decode('utf-8') - assert_equal(html, open(expected_output_file_path, 'rb').read()) + self.assertEqual(html, io.open(expected_output_file_path).read()) @raises(NoDublinCore)