fixed broken tests
authorMarcin Koziej <marcin.koziej@nowoczesnapolska.org.pl>
Thu, 22 Dec 2011 12:24:57 +0000 (13:24 +0100)
committerMarcin Koziej <marcin.koziej@nowoczesnapolska.org.pl>
Thu, 22 Dec 2011 12:24:57 +0000 (13:24 +0100)
librarian/picture.py
tests/files/picture/angelus-novus.xml
tests/test_picture.py

index edf541f..0f5c99a 100644 (file)
@@ -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
index b3b9ccb..0f26730 100644 (file)
@@ -19,7 +19,8 @@
       <dc:date.pd xml:lang="pl">1940</dc:date.pd>
       <dc:type>Image</dc:type>
       <dc:format xml:lang="pl">image/png</dc:format>
-      <dc:format.dimensions.digital xml:lang="pl">1645 x 2000 px</dc:format.dimensions.digital>
+      <dc:format.dimensions xml:lang="pl">1645 x 2000 px</dc:format.dimensions>
+      <dc:format.checksum.sha1 xml:lang="pl">d9ead48f3442ac4e1add602aacdffa4638ae8e21</dc:format.checksum.sha1>
       <dc:date xml:lang="pl">1920</dc:date>
       <dc:language xml:lang="pl" xmlns:dc="http://purl.org/dc/elements/1.1/">lat</dc:language>
     </rdf:Description>
index 35f2cf9..71a77dc 100644 (file)
@@ -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']: