1 # -*- coding: utf-8 -*-
3 # This file is part of Librarian.
5 # Copyright © 2008,2009,2010 Fundacja Nowoczesna Polska <fundacja@nowoczesnapolska.org.pl>
7 # For full list of contributors see AUTHORS file.
9 # This program is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU Affero General Public License as published by
11 # the Free Software Foundation, either version 3 of the License, or
12 # (at your option) any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU Affero General Public License for more details.
19 # You should have received a copy of the GNU Affero General Public License
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
22 from librarian import html, NoDublinCore
23 from nose.tools import *
24 from utils import get_fixture, remove_output_file
27 def teardown_transform():
28 remove_output_file('text', 'asnyk_miedzy_nami.html')
31 @with_setup(None, teardown_transform)
33 output_file_path = get_fixture('text', 'asnyk_miedzy_nami.html')
34 expected_output_file_path = get_fixture('text', 'asnyk_miedzy_nami_expected.html')
37 get_fixture('text', 'asnyk_miedzy_nami.xml'),
41 assert_equal(file(output_file_path).read(), file(expected_output_file_path).read())
44 @with_setup(None, teardown_transform)
46 def test_no_dublincore():
48 get_fixture('text', 'asnyk_miedzy_nami_nodc.xml'),
49 get_fixture('text', 'asnyk_miedzy_nami_nodc.html'),
53 @with_setup(None, teardown_transform)
54 def test_passing_parse_dublincore_to_transform():
55 """Passing parse_dublincore=False to transform omits DublinCore parsing."""
57 get_fixture('text', 'asnyk_miedzy_nami_nodc.xml'),
58 get_fixture('text', 'asnyk_miedzy_nami.html'),
59 parse_dublincore=False,