Skip to content

Commit

Permalink
CollectionRefs must have a label.
Browse files Browse the repository at this point in the history
  • Loading branch information
markpbaggett committed Jan 21, 2025
1 parent 71187ac commit c5eaa23
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion iiif_prezi3/helpers/make_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ def make_collection(self, **kwargs):
and returns the newly created object. Accepts keyword arguments to
customize the resulting instance.
"""
if 'items' not in kwargs or not kwargs['items']:
if 'items' not in kwargs:
child_collection = CollectionRef(**kwargs)
elif not kwargs['items']:
kwargs.pop('items')
child_collection = CollectionRef(**kwargs)
else:
Expand Down
4 changes: 3 additions & 1 deletion tests/test_make_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ def setUp(self):

def test_make_collection(self):
child_collection = self.parent_collection.make_collection(
id='http://iiif.example.org/prezi/Manifest/0')
id='http://iiif.example.org/prezi/Manifest/0',
label="Example Collection"
)
self.assertEqual(len(self.parent_collection.items), 1)
self.assertEqual(child_collection.id,
'http://iiif.example.org/prezi/Manifest/0')

0 comments on commit c5eaa23

Please sign in to comment.