1 # -*- coding: utf-8 -*-
3 # This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
4 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
6 from librarian import text, NoDublinCore
7 from nose.tools import *
8 from utils import get_fixture, remove_output_file
11 def teardown_transform():
12 remove_output_file('text', 'asnyk_miedzy_nami.txt')
15 @with_setup(None, teardown_transform)
17 output_file_path = get_fixture('text', 'asnyk_miedzy_nami.txt')
18 expected_output_file_path = get_fixture('text', 'asnyk_miedzy_nami_expected.txt')
21 open(get_fixture('text', 'asnyk_miedzy_nami.xml')),
22 open(output_file_path, 'w'),
25 assert_equal(file(output_file_path).read(), file(expected_output_file_path).read())
28 @with_setup(None, teardown_transform)
30 def test_no_dublincore():
32 open(get_fixture('text', 'asnyk_miedzy_nami_nodc.xml')),
33 open(get_fixture('text', 'asnyk_miedzy_nami.txt'), 'w'),
37 @with_setup(None, teardown_transform)
38 def test_passing_parse_dublincore_to_transform():
39 """Passing parse_dublincore=False to transform omits DublinCore parsing."""
41 open(get_fixture('text', 'asnyk_miedzy_nami_nodc.xml')),
42 open(get_fixture('text', 'asnyk_miedzy_nami.txt'), 'w'),
43 parse_dublincore=False,