X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/14fbd48817ba27853a45164908d10ed679acac6e..7231c2b5e9364aefd27a0bc8a1033de90bb3d878:/tests/test_picture.py?ds=inline diff --git a/tests/test_picture.py b/tests/test_picture.py index 1169f44..7d12b1d 100644 --- a/tests/test_picture.py +++ b/tests/test_picture.py @@ -3,17 +3,17 @@ # This file is part of Librarian, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # +from __future__ import unicode_literals + from librarian import picture, dcparser -from lxml import etree -from nose.tools import * -from os.path import splitext from tests.utils import get_all_fixtures, get_fixture -import codecs from os import path + def test_wlpictureuri(): uri = picture.WLPictureURI('http://wolnelektury.pl/katalog/obraz/angelus-novus') + def check_load(xml_file): pi = dcparser.parse(xml_file, picture.PictureInfo) assert pi is not None @@ -36,9 +36,10 @@ def test_wlpicture(): assert path.exists(wlp.image_path) - f = wlp.image_file('r') + f = wlp.image_file() f.close() + def test_picture_parts(): wlp = picture.WLPicture.from_file(open(get_fixture('picture', 'angelus-novus.xml'))) parts = list(wlp.partiter()) @@ -47,7 +48,6 @@ def test_picture_parts(): motifs = set() names = set() - print parts for p in parts: for m in p['themes']: motifs.add(m) @@ -55,7 +55,5 @@ def test_picture_parts(): if p['object']: names.add(p['object']) - assert motifs == set([u'anioł historii', u'spojrzenie']), "missing motifs, got: %s" % motifs - assert names == set([u'obraz cały', u'skrzydło']), 'missing objects, got: %s' % names - - + assert motifs == {u'anioł historii', u'spojrzenie'}, "missing motifs, got: %s" % motifs + assert names == {u'obraz cały', u'skrzydło'}, 'missing objects, got: %s' % names