diff --git a/tests/sample/pictures/dir1/test2/21.md b/tests/sample/pictures/dir1/test2/21.md new file mode 100644 index 0000000..576d6c7 --- /dev/null +++ b/tests/sample/pictures/dir1/test2/21.md @@ -0,0 +1 @@ +Order: 01 diff --git a/tests/sample/pictures/dir1/test2/22.md b/tests/sample/pictures/dir1/test2/22.md new file mode 100644 index 0000000..0d4b373 --- /dev/null +++ b/tests/sample/pictures/dir1/test2/22.md @@ -0,0 +1 @@ +Order: 02 diff --git a/tests/test_gallery.py b/tests/test_gallery.py index 17d905b..bc2c171 100644 --- a/tests/test_gallery.py +++ b/tests/test_gallery.py @@ -220,6 +220,12 @@ def test_medias_sort(settings): assert [im.filename for im in a.images] == ['22.jpg', '21.jpg', 'archlinux-kiss-1024x640.png'] + settings['medias_sort_attr'] = 'meta.order' + settings['medias_sort_reverse'] = False + a = Album('dir1/test2', settings, album['subdirs'], album['medias'], gal) + a.sort_medias(settings['medias_sort_attr']) + assert [im.filename for im in a.images] == ['archlinux-kiss-1024x640.png', '21.jpg', '22.jpg'] + def test_gallery(settings, tmpdir): "Test the Gallery class."