1 # -*- coding: utf-8 -*-
3 # Copyright © 2008,2009,2010 Fundacja Nowoczesna Polska
5 # This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
6 # For full license text see COPYING or <http://www.gnu.org/licenses/agpl.html>
8 from librarian import text, NoDublinCore
9 from nose.tools import *
10 from utils import get_fixture, remove_output_file
13 def teardown_transform():
14 remove_output_file('text', 'asnyk_miedzy_nami.txt')
17 @with_setup(None, teardown_transform)
19 output_file_path = get_fixture('text', 'asnyk_miedzy_nami.txt')
20 expected_output_file_path = get_fixture('text', 'asnyk_miedzy_nami_expected.txt')
23 get_fixture('text', 'asnyk_miedzy_nami.xml'),
27 assert_equal(file(output_file_path).read(), file(expected_output_file_path).read())
30 @with_setup(None, teardown_transform)
32 def test_no_dublincore():
34 get_fixture('text', 'asnyk_miedzy_nami_nodc.xml'),
35 get_fixture('text', 'asnyk_miedzy_nami_nodc.txt'),
39 @with_setup(None, teardown_transform)
40 def test_passing_parse_dublincore_to_transform():
41 """Passing parse_dublincore=False to transform omits DublinCore parsing."""
43 get_fixture('text', 'asnyk_miedzy_nami_nodc.xml'),
44 get_fixture('text', 'asnyk_miedzy_nami.txt'),
45 parse_dublincore=False,