X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/a3c860f00c7d12ae5852ddab056c98f52ee43072..a31e3178735b133e86b013da22acf38bd1b83534:/tests/test_picture.py?ds=inline

diff --git a/tests/test_picture.py b/tests/test_picture.py
index 4e3b252..71a77dc 100644
--- a/tests/test_picture.py
+++ b/tests/test_picture.py
@@ -38,3 +38,23 @@ def test_wlpicture():
     
     f = wlp.image_file('r')
     f.close()
+
+def test_picture_parts():
+    wlp = picture.WLPicture.from_file(open(get_fixture('picture', 'angelus-novus.xml')))
+    parts = list(wlp.partiter())
+    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['themes']:
+            motifs.add(m)
+    for p in 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
+    
+