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
26 def teardown_transform():
27 remove_output_file('text', 'asnyk_miedzy_nami.html')
30 @with_setup(None, teardown_transform)
32 output_file_path = get_fixture('text', 'asnyk_miedzy_nami.html')
33 expected_output_file_path = get_fixture('text', 'asnyk_miedzy_nami_expected.html')
36 get_fixture('text', 'asnyk_miedzy_nami.xml'),
40 assert_equal(file(output_file_path).read(), file(expected_output_file_path).read())
43 @with_setup(None, teardown_transform)
45 def test_no_dublincore():
47 get_fixture('text', 'asnyk_miedzy_nami_nodc.xml'),
48 get_fixture('text', 'asnyk_miedzy_nami_nodc.html'),
52 @with_setup(None, teardown_transform)
53 def test_passing_parse_dublincore_to_transform():
54 """Passing parse_dublincore=False to transform omits DublinCore parsing."""
56 get_fixture('text', 'asnyk_miedzy_nami_nodc.xml'),
57 get_fixture('text', 'asnyk_miedzy_nami.html'),
58 parse_dublincore=False,