X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/2c15db814c7f40406b6a86383e3e4bc8825b7faf..23d025c8875cca1404f274aca7170c9db5e980e7:/tests/test_html_transform_abstrakt.py diff --git a/tests/test_html_transform_abstrakt.py b/tests/test_html_transform_abstrakt.py index dbe22c0..ae7fbe5 100644 --- a/tests/test_html_transform_abstrakt.py +++ b/tests/test_html_transform_abstrakt.py @@ -1,20 +1,20 @@ -# -*- 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 - -from librarian.parser import WLDocument -from librarian.html import transform_abstrakt -from nose.tools import * +import unittest +from librarian.document import WLDocument +from librarian.builders.html import AbstraktHtmlBuilder from .utils import get_fixture -def test_fragments(): - transform_abstrakt( - WLDocument.from_file( - get_fixture('text', 'abstrakt.xml'), - parse_dublincore=False - ).edoc.getroot().find('.//abstrakt') - ) +class AbstractTests(unittest.TestCase): + def test_abstrakt(self): + builder = AbstraktHtmlBuilder() + got = builder.build( + WLDocument( + filename=get_fixture('text', 'abstrakt.xml'), + ) + ).get_bytes().decode('utf-8') + with open(get_fixture('text', 'abstrakt.expected.html')) as f: + expected = f.read() + self.assertEqual(expected, got)