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 __future__ import unicode_literals
 
   8 from librarian import NoDublinCore
 
   9 from librarian.parser import WLDocument
 
  10 from nose.tools import *
 
  11 from .utils import get_fixture
 
  15     expected_output_file_path = get_fixture('text', 'asnyk_miedzy_nami_expected.html')
 
  17     html = WLDocument.from_file(
 
  18             get_fixture('text', 'miedzy-nami-nic-nie-bylo.xml')
 
  19         ).as_html().get_bytes()
 
  21     assert_equal(html, open(expected_output_file_path, 'rb').read())
 
  25 def test_no_dublincore():
 
  27             get_fixture('text', 'asnyk_miedzy_nami_nodc.xml')
 
  31 def test_passing_parse_dublincore_to_transform():
 
  32     """Passing parse_dublincore=False to transform omits DublinCore parsing."""
 
  34             get_fixture('text', 'asnyk_miedzy_nami_nodc.xml'),
 
  35             parse_dublincore=False,
 
  40     assert not WLDocument.from_bytes(
 
  42             parse_dublincore=False,