From: Marcin Koziej Date: Thu, 22 Dec 2011 12:24:57 +0000 (+0100) Subject: fixed broken tests X-Git-Tag: 1.7~175 X-Git-Url: https://git.mdrn.pl/librarian.git/commitdiff_plain/5fed78856949474a36bc5e268517775a9a802e27?ds=sidebyside;hp=-c fixed broken tests --- 5fed78856949474a36bc5e268517775a9a802e27 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']: