def test_medias_sort(settings): gal = Gallery(settings, ncpu=1) album = REF['dir1/test2'] settings['medias_sort_reverse'] = True 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] == list(reversed(album['medias'])) settings['medias_sort_attr'] = 'date' 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] == ['22.jpg', '21.jpg', 'archlinux-kiss-1024x640.png']
def test_medias_sort(settings): gal = Gallery(settings, ncpu=1) album = REF['dir1/test2'] settings['medias_sort_reverse'] = True 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] == list(reversed(album['medias'])) settings['medias_sort_attr'] = 'date' 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 ] == ['22.jpg', '21.jpg', 'archlinux-kiss-1024x640.png']
def test_medias_sort(settings): gal = Gallery(settings, ncpu=1) album = REF['dir1/test2'] settings['medias_sort_reverse'] = True a = Album('dir1/test2', settings, album['subdirs'], album['medias'], gal) a.sort_medias(settings['medias_sort_attr']) assert [im.dst_filename for im in a.images] == list(reversed(album['medias'])) settings['medias_sort_attr'] = 'date' settings['medias_sort_reverse'] = False a = Album('dir1/test2', settings, album['subdirs'], album['medias'], gal) a.sort_medias(settings['medias_sort_attr']) assert a.medias[0].src_filename == '22.jpg' 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.dst_filename for im in a.images] == [ '21.tiff', '22.jpg', 'CMB_Timeline300_no_WMAP.jpg', ]
def test_medias_sort(settings): gal = Gallery(settings, ncpu=1) album = REF['dir1/test2'] settings['medias_sort_reverse'] = True 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] == list(reversed(album['medias'])) settings['medias_sort_attr'] = 'date' 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] == ['22.jpg', '21.jpg', 'CMB_Timeline300_no_WMAP.jpg'] 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] == [ 'CMB_Timeline300_no_WMAP.jpg', '21.jpg', '22.jpg']