From 5fed78856949474a36bc5e268517775a9a802e27 Mon Sep 17 00:00:00 2001 From: Marcin Koziej Date: Thu, 22 Dec 2011 13:24:57 +0100 Subject: [PATCH] fixed broken tests --- librarian/picture.py | 4 ++-- tests/files/picture/angelus-novus.xml | 3 ++- tests/test_picture.py | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/librarian/picture.py b/librarian/picture.py index edf541f..0f5c99a 100644 --- a/librarian/picture.py +++ b/librarian/picture.py @@ -176,6 +176,6 @@ class WLPicture(object): if parent.tag == 'sem': if parent.get('type') == 'theme': pd['themes'] += map(unicode.strip, unicode(parent.get('theme')).split(',')) - elif parent.get('type') == 'object' and not pd['object']: - pd['object'] = parent.get('name') + elif parent.get('type') == 'object' and pd['object'] is None: + pd['object'] = parent.get('object') yield pd diff --git a/tests/files/picture/angelus-novus.xml b/tests/files/picture/angelus-novus.xml index b3b9ccb..0f26730 100644 --- a/tests/files/picture/angelus-novus.xml +++ b/tests/files/picture/angelus-novus.xml @@ -19,7 +19,8 @@ 1940 Image image/png - 1645 x 2000 px + 1645 x 2000 px + d9ead48f3442ac4e1add602aacdffa4638ae8e21 1920 lat diff --git a/tests/test_picture.py b/tests/test_picture.py index 35f2cf9..71a77dc 100644 --- a/tests/test_picture.py +++ b/tests/test_picture.py @@ -45,9 +45,10 @@ def test_picture_parts(): assert len(parts) == 5, "there should be %d parts of the picture" % 5 motifs = set() names = set() - + + print parts for p in parts: - for m in p['motifs']: + for m in p['themes']: motifs.add(m) for p in parts: if p['object']: -- 2.20.1