Browse Source

Add doc page with licenses and replace a few images

whose license/origin is unclear
pull/340/head
Simon Conseil 8 years ago
parent
commit
fbb056e3b9
  1. 1
      docs/index.rst
  2. 54
      docs/license.rst
  3. BIN
      tests/sample/pictures/accentué/11.jpg
  4. BIN
      tests/sample/pictures/accentué/superdupont_source_wikipedia_en.jpg
  5. BIN
      tests/sample/pictures/dir1/test1/50a1d0bc-763d-457e-b634-c87f16a64270.gif
  6. BIN
      tests/sample/pictures/dir1/test1/CMB_Timeline300_no_WMAP.jpg
  7. BIN
      tests/sample/pictures/dir1/test1/archlinux-kiss-1024x640.png
  8. BIN
      tests/sample/pictures/dir1/test1/example.gif
  9. BIN
      tests/sample/pictures/dir1/test2/CMB_Timeline300_no_WMAP.jpg
  10. BIN
      tests/sample/pictures/dir1/test2/archlinux-kiss-1024x640.png
  11. BIN
      tests/sample/pictures/dir2/KeckObservatory20071020.jpg
  12. BIN
      tests/sample/pictures/dir2/exo20101028-b-full.jpg
  13. 25
      tests/sample/pictures/dir2/index.md
  14. BIN
      tests/sample/pictures/exifTest/noexif.png
  15. BIN
      tests/sample/pictures/video/example video.ogv
  16. BIN
      tests/sample/pictures/video/stallman software-freedom-day-low.ogv
  17. 4
      tests/sample/sigal.conf.py
  18. BIN
      tests/sample/watermark.png
  19. 6
      tests/test_cli.py
  20. 33
      tests/test_gallery.py
  21. 10
      tests/test_image.py
  22. 2
      tests/test_plugins.py
  23. 4
      tests/test_utils.py
  24. 2
      tests/test_video.py
  25. 4
      tests/test_zip.py

1
docs/index.rst

@ -15,4 +15,5 @@ Documentation
plugins plugins
faq faq
contribute contribute
license
changelog changelog

54
docs/license.rst

@ -0,0 +1,54 @@
=========
License
=========
Sigal itself is available under the MIT license, but it also relies on several
librairies (thanks!):
- `Colorbox <http://www.jacklmoore.com/colorbox>`__ (MIT)
- `Galleria <http://galleria.io/>`__ (MIT)
- `Photoswipe <http://photoswipe.com/>`__ (MIT)
- `JQuery <https://jquery.org/>`__ (MIT)
- `JQuery TouchSwipe <https://github.com/mattbryson/TouchSwipe-Jquery-Plugin>`__ (MIT)
- `Skeleton <http://getskeleton.com/>`__ (MIT)
- `normalize.css <https://github.com/necolas/normalize.css>`__ (MIT)
- `Leaflet <http://leafletjs.com/>`__ (BSD)
- `echo <https://github.com/toddmotto/echo>`__ (MIT)
The ``tests/sample/pictures`` directory contain images used for the unit
tests:
- ``11.jpg``, ``21.jpg``, ``22.jpg``, ``3.jpg`` : From @saimn
- ``1.jpg``, ``2.jpg`` : From @edwinsteele
(https://github.com/saimn/sigal/pull/297#issuecomment-365879755)
- ``example.gif`` :
https://commons.wikimedia.org/wiki/File:00_nuvolosit%C3%A0_media_AM.GIF
(CC-BY-3.0)
- ``CMB_Timeline300_no_WMAP.jpg`` :
https://en.wikipedia.org/wiki/File:CMB_Timeline300_no_WMAP.jpg
(Public domain)
- ``KeckObservatory20071020.jpg`` :
https://commons.wikimedia.org/wiki/File:KeckObservatory20071020.jpg
(CC-BY-3.0)
- ``flickr_jerquiaga_2394751088_cc-by-nc.jpg``
http://www.flickr.com/photos/jerquiaga/2394751088/ (CC-BY-NC)
- ``hélicoïde.jpg`` : https://commons.wikimedia.org/wiki/File:Helicoid.PNG
(CC BY-SA 3.0)
- ``Hubble Interacting Galaxy NGC 5257.jpg``
https://commons.wikimedia.org/wiki/File:Hubble_Interacting_Galaxy_NGC_5257_(2008-04-24).jpg
(Public domain)
- ``Hubble ultra deep field.jpg`` :
https://commons.wikimedia.org/wiki/File%3AHubble_ultra_deep_field.jpg
(Public domain)
- ``m57_the_ring_nebula-587px.jpg``
https://commons.wikimedia.org/wiki/File%3AM57_The_Ring_Nebula.JPG
(Public domain)
- ``noexif.png`` : https://commons.wikimedia.org/wiki/File:Ilc_9yr_moll4096.png
(Public domain)
- ``should_be_created.jpg``, ``should_be_ignored_1.jpg``,
``should_be_ignored2.jpg``, ``should_be_ignored3.jpg``,
``should_be_ignored.jpg`` : from the apollo 7 mission, public domain:
https://www.flickr.com/photos/projectapolloarchive/21756099278/in/album-72157657129869694/
(https://github.com/saimn/sigal/pull/233#issuecomment-275430083)
- ``example video.ogv`` : https://commons.wikimedia.org/wiki/File:I-15bis.ogv
(GFDL)

BIN
tests/sample/pictures/accentué/11.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

BIN
tests/sample/pictures/accentué/superdupont_source_wikipedia_en.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

BIN
tests/sample/pictures/dir1/test1/50a1d0bc-763d-457e-b634-c87f16a64270.gif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

BIN
tests/sample/pictures/dir1/test1/CMB_Timeline300_no_WMAP.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

BIN
tests/sample/pictures/dir1/test1/archlinux-kiss-1024x640.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 KiB

BIN
tests/sample/pictures/dir1/test1/example.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

BIN
tests/sample/pictures/dir1/test2/CMB_Timeline300_no_WMAP.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

BIN
tests/sample/pictures/dir1/test2/archlinux-kiss-1024x640.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 KiB

BIN
tests/sample/pictures/dir2/KeckObservatory20071020.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
tests/sample/pictures/dir2/exo20101028-b-full.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

25
tests/sample/pictures/dir2/index.md

@ -10,19 +10,22 @@ This is an [example link](http://example.com/ "With a Title").
### Image sources ### Image sources
- *Hubble Interacting Galaxy NGC 5257* By NASA, ESA, the Hubble Heritage - *Hubble Interacting Galaxy NGC 5257* : By NASA, ESA, the Hubble Heritage
(STScI/AURA)-ESA/Hubble Collaboration, and A. Evans (University of Virginia, (STScI/AURA)-ESA/Hubble Collaboration, and A. Evans (University of Virginia,
Charlottesville/NRAO/Stony Brook University) [Public domain], via Wikimedia Charlottesville/NRAO/Stony Brook University) [Public domain], <a
Commons href="https://commons.wikimedia.org/wiki/File:Hubble_Interacting_Galaxy_NGC_5257_(2008-04-24).jpg">
from Wikimedia Commons</a>
- *Hubble ultra deep field.jpg* Par NASA and the European Space Agency. [Public - *Hubble ultra deep field.jpg* : By NASA and the European Space Agency.
domain], <a [Public domain], <a
href="https://commons.wikimedia.org/wiki/File%3AHubble_ultra_deep_field.jpg">via href="https://commons.wikimedia.org/wiki/File%3AHubble_ultra_deep_field.jpg">
Wikimedia Commons</a> from Wikimedia Commons</a>
- *m57_the_ring_nebula-587px.jpg* By The Hubble Heritage Team - *m57_the_ring_nebula-587px.jpg* : By The Hubble Heritage Team
(AURA/STScI/NASA) [Public domain], <a (AURA/STScI/NASA) [Public domain], <a
href="https://commons.wikimedia.org/wiki/File%3AM57_The_Ring_Nebula.JPG">via href="https://commons.wikimedia.org/wiki/File%3AM57_The_Ring_Nebula.JPG">
Wikimedia Commons</a> from Wikimedia Commons</a>
- *exo20101028-b-full.jpg* - *KeckObservatory20071020.jpg* : By SiOwl [CC BY 3.0] <a
href="https://commons.wikimedia.org/wiki/File:KeckObservatory20071020.jpg">
from Wikimedia Commons</a>

BIN
tests/sample/pictures/exifTest/noexif.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 KiB

After

Width:  |  Height:  |  Size: 108 KiB

BIN
tests/sample/pictures/video/example video.ogv

Binary file not shown.

BIN
tests/sample/pictures/video/stallman software-freedom-day-low.ogv

Binary file not shown.

4
tests/sample/sigal.conf.py

@ -13,10 +13,10 @@ plugins = ['sigal.plugins.adjust', 'sigal.plugins.copyright',
'sigal.plugins.watermark', 'sigal.plugins.feeds', 'sigal.plugins.watermark', 'sigal.plugins.feeds',
'sigal.plugins.nomedia', 'sigal.plugins.extended_caching'] 'sigal.plugins.nomedia', 'sigal.plugins.extended_caching']
copyright = '© An example copyright message' copyright = '© An example copyright message'
adjust_options = {'color': 0.0, 'brightness': 1.0, adjust_options = {'color': 0.9, 'brightness': 1.0,
'contrast': 1.0, 'sharpness': 0.0} 'contrast': 1.0, 'sharpness': 0.0}
watermark = 'watermark.png' watermark = 'watermark.png'
watermark_position = 'tile' watermark_position = (10, 10)
watermark_opacity = 0.3 watermark_opacity = 0.3
theme = 'colorbox' theme = 'colorbox'

BIN
tests/sample/watermark.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

6
tests/test_cli.py

@ -34,8 +34,8 @@ def test_build(tmpdir, disconnect_signals):
assert result.exit_code == 0 assert result.exit_code == 0
os.symlink(join(TESTGAL, 'watermark.png'), os.symlink(join(TESTGAL, 'watermark.png'),
join(tmpdir, 'watermark.png')) join(tmpdir, 'watermark.png'))
os.symlink(join(TESTGAL, 'pictures', 'dir2', 'exo20101028-b-full.jpg'), os.symlink(join(TESTGAL, 'pictures', 'dir2', 'KeckObservatory20071020.jpg'),
join(tmpdir, 'pictures', 'exo20101028-b-full.jpg')) join(tmpdir, 'pictures', 'KeckObservatory20071020.jpg'))
result = runner.invoke(build, ['-n', 1, '--debug']) result = runner.invoke(build, ['-n', 1, '--debug'])
assert result.exit_code == 1 assert result.exit_code == 1
@ -76,7 +76,7 @@ atom_feed = {'feed_url': 'http://example.org/feed.atom', 'nb_items': 10}
'-n', 1, '--debug']) '-n', 1, '--debug'])
assert result.exit_code == 0 assert result.exit_code == 0
assert os.path.isfile(join(tmpdir, 'build', 'thumbnails', assert os.path.isfile(join(tmpdir, 'build', 'thumbnails',
'exo20101028-b-full.jpg')) 'KeckObservatory20071020.jpg'))
assert os.path.isfile(join(tmpdir, 'build', 'feed.atom')) assert os.path.isfile(join(tmpdir, 'build', 'feed.atom'))
assert os.path.isfile(join(tmpdir, 'build', 'feed.rss')) assert os.path.isfile(join(tmpdir, 'build', 'feed.rss'))
assert os.path.isfile(join(tmpdir, 'build', 'watermark.png')) assert os.path.isfile(join(tmpdir, 'build', 'watermark.png'))

33
tests/test_gallery.py

@ -22,16 +22,16 @@ REF = {
'name': 'test1', 'name': 'test1',
'thumbnail': 'test1/thumbnails/11.tn.jpg', 'thumbnail': 'test1/thumbnails/11.tn.jpg',
'subdirs': [], 'subdirs': [],
'medias': ['11.jpg', 'archlinux-kiss-1024x640.png', 'medias': ['11.jpg', 'CMB_Timeline300_no_WMAP.jpg',
'flickr_jerquiaga_2394751088_cc-by-nc.jpg', 'flickr_jerquiaga_2394751088_cc-by-nc.jpg',
'50a1d0bc-763d-457e-b634-c87f16a64270.gif'], 'example.gif'],
}, },
'dir1/test2': { 'dir1/test2': {
'title': 'test2', 'title': 'test2',
'name': 'test2', 'name': 'test2',
'thumbnail': 'test2/thumbnails/21.tn.jpg', 'thumbnail': 'test2/thumbnails/21.tn.jpg',
'subdirs': [], 'subdirs': [],
'medias': ['21.jpg', '22.jpg', 'archlinux-kiss-1024x640.png'], 'medias': ['21.jpg', '22.jpg', 'CMB_Timeline300_no_WMAP.jpg'],
}, },
'dir1/test3': { 'dir1/test3': {
'title': '01 First title alphabetically', 'title': '01 First title alphabetically',
@ -45,7 +45,7 @@ REF = {
'name': 'dir2', 'name': 'dir2',
'thumbnail': 'dir2/thumbnails/m57_the_ring_nebula-587px.tn.jpg', 'thumbnail': 'dir2/thumbnails/m57_the_ring_nebula-587px.tn.jpg',
'subdirs': [], 'subdirs': [],
'medias': ['exo20101028-b-full.jpg', 'medias': ['KeckObservatory20071020.jpg',
'Hubble Interacting Galaxy NGC 5257.jpg', 'Hubble Interacting Galaxy NGC 5257.jpg',
'Hubble ultra deep field.jpg', 'Hubble ultra deep field.jpg',
'm57_the_ring_nebula-587px.jpg'], 'm57_the_ring_nebula-587px.jpg'],
@ -55,15 +55,15 @@ REF = {
'name': 'accentué', 'name': 'accentué',
'thumbnail': 'accentué/thumbnails/hélicoïde.tn.jpg', 'thumbnail': 'accentué/thumbnails/hélicoïde.tn.jpg',
'subdirs': [], 'subdirs': [],
'medias': ['hélicoïde.jpg', 'superdupont_source_wikipedia_en.jpg'], 'medias': ['hélicoïde.jpg', '11.jpg'],
}, },
'video': { 'video': {
'title': 'video', 'title': 'video',
'name': 'video', 'name': 'video',
'thumbnail': ('video/thumbnails/' 'thumbnail': ('video/thumbnails/'
'stallman software-freedom-day-low.tn.jpg'), 'example video.tn.jpg'),
'subdirs': [], 'subdirs': [],
'medias': ['stallman software-freedom-day-low.ogv'] 'medias': ['example video.ogv']
} }
} }
@ -97,9 +97,9 @@ def test_media_orig(settings, tmpdir):
m = Image('11.jpg', 'dir1/test1', settings) m = Image('11.jpg', 'dir1/test1', settings)
assert m.big == 'original/11.jpg' assert m.big == 'original/11.jpg'
m = Video('stallman software-freedom-day-low.ogv', 'video', settings) m = Video('example video.ogv', 'video', settings)
assert m.filename == 'stallman software-freedom-day-low.webm' assert m.filename == 'example video.webm'
assert m.big == 'original/stallman software-freedom-day-low.ogv' assert m.big == 'original/example video.ogv'
assert os.path.isfile(join(settings['destination'], m.path, m.big)) assert os.path.isfile(join(settings['destination'], m.path, m.big))
settings['use_orig'] = True settings['use_orig'] = True
@ -138,14 +138,13 @@ def test_image(settings, tmpdir):
def test_video(settings, tmpdir): def test_video(settings, tmpdir):
settings['destination'] = str(tmpdir) settings['destination'] = str(tmpdir)
m = Video('stallman software-freedom-day-low.ogv', 'video', settings) m = Video('example video.ogv', 'video', settings)
file_path = join('video', 'stallman software-freedom-day-low.webm') file_path = join('video', 'example video.webm')
assert str(m) == file_path assert str(m) == file_path
assert m.dst_path == join(settings['destination'], file_path) assert m.dst_path == join(settings['destination'], file_path)
os.makedirs(join(settings['destination'], 'video', 'thumbnails')) os.makedirs(join(settings['destination'], 'video', 'thumbnails'))
assert m.thumbnail == join('thumbnails', assert m.thumbnail == join('thumbnails', 'example video.tn.jpg')
'stallman software-freedom-day-low.tn.jpg')
assert os.path.isfile(m.thumb_path) assert os.path.isfile(m.thumb_path)
@ -222,14 +221,14 @@ def test_medias_sort(settings):
a = Album('dir1/test2', settings, album['subdirs'], album['medias'], gal) a = Album('dir1/test2', settings, album['subdirs'], album['medias'], gal)
a.sort_medias(settings['medias_sort_attr']) a.sort_medias(settings['medias_sort_attr'])
assert [im.filename for im in a.images] == ['22.jpg', '21.jpg', assert [im.filename for im in a.images] == ['22.jpg', '21.jpg',
'archlinux-kiss-1024x640.png'] 'CMB_Timeline300_no_WMAP.jpg']
settings['medias_sort_attr'] = 'meta.order' settings['medias_sort_attr'] = 'meta.order'
settings['medias_sort_reverse'] = False settings['medias_sort_reverse'] = False
a = Album('dir1/test2', settings, album['subdirs'], album['medias'], gal) a = Album('dir1/test2', settings, album['subdirs'], album['medias'], gal)
a.sort_medias(settings['medias_sort_attr']) a.sort_medias(settings['medias_sort_attr'])
assert [im.filename for im in a.images] == [ assert [im.filename for im in a.images] == [
'archlinux-kiss-1024x640.png', '21.jpg', '22.jpg'] 'CMB_Timeline300_no_WMAP.jpg', '21.jpg', '22.jpg']
def test_gallery(settings, tmpdir): def test_gallery(settings, tmpdir):
@ -275,7 +274,7 @@ def test_ignores(settings, tmpdir):
assert 'test2' not in os.listdir(join(tmp, 'dir1')) assert 'test2' not in os.listdir(join(tmp, 'dir1'))
assert 'accentué' not in os.listdir(tmp) assert 'accentué' not in os.listdir(tmp)
assert 'archlinux-kiss-1024x640.png' not in os.listdir( assert 'CMB_Timeline300_no_WMAP.jpg' not in os.listdir(
join(tmp, 'dir1', 'test1')) join(tmp, 'dir1', 'test1'))
assert 'Hubble Interacting Galaxy NGC 5257.jpg' not in os.listdir( assert 'Hubble Interacting Galaxy NGC 5257.jpg' not in os.listdir(
join(tmp, 'dir2')) join(tmp, 'dir2'))

10
tests/test_image.py

@ -9,10 +9,10 @@ from sigal.image import (generate_image, generate_thumbnail, get_exif_tags,
from sigal.settings import create_settings, Status from sigal.settings import create_settings, Status
CURRENT_DIR = os.path.dirname(__file__) CURRENT_DIR = os.path.dirname(__file__)
TEST_IMAGE = 'exo20101028-b-full.jpg' TEST_IMAGE = 'KeckObservatory20071020.jpg'
SRCFILE = os.path.join(CURRENT_DIR, 'sample', 'pictures', 'dir2', TEST_IMAGE) SRCFILE = os.path.join(CURRENT_DIR, 'sample', 'pictures', 'dir2', TEST_IMAGE)
TEST_GIF_IMAGE = '50a1d0bc-763d-457e-b634-c87f16a64270.gif' TEST_GIF_IMAGE = 'example.gif'
SRC_GIF_FILE = os.path.join(CURRENT_DIR, 'sample', 'pictures', SRC_GIF_FILE = os.path.join(CURRENT_DIR, 'sample', 'pictures',
'dir1', 'test1', TEST_GIF_IMAGE) 'dir1', 'test1', TEST_GIF_IMAGE)
@ -60,7 +60,7 @@ def test_resize_image_portrait(tmpdir):
# Hence we test that the shorter side has the smallest length. # Hence we test that the shorter side has the smallest length.
assert im.size[0] == 200 assert im.size[0] == 200
landscape_image = 'exo20101028-b-full.jpg' landscape_image = 'KeckObservatory20071020.jpg'
landscape_src = os.path.join(CURRENT_DIR, 'sample', 'pictures', 'dir2', landscape_image) landscape_src = os.path.join(CURRENT_DIR, 'sample', 'pictures', 'dir2', landscape_image)
landscape_dst = str(tmpdir.join(landscape_image)) landscape_dst = str(tmpdir.join(landscape_image))
@ -109,8 +109,8 @@ def test_generate_image_processor(tmpdir):
@pytest.mark.parametrize( @pytest.mark.parametrize(
("image", "path", "wide_size", "high_size"), ("image", "path", "wide_size", "high_size"),
[(TEST_IMAGE, SRCFILE, (185, 150), (150, 122)), [(TEST_IMAGE, SRCFILE, (200, 133), (150, 100)),
(TEST_GIF_IMAGE, SRC_GIF_FILE, (127, 150), (150, 177))]) (TEST_GIF_IMAGE, SRC_GIF_FILE, (134, 150), (150, 167))])
def test_generate_thumbnail(tmpdir, image, path, wide_size, high_size): def test_generate_thumbnail(tmpdir, image, path, wide_size, high_size):
"Test the generate_thumbnail function." "Test the generate_thumbnail function."

2
tests/test_plugins.py

@ -19,7 +19,7 @@ def test_plugins(settings, tmpdir, disconnect_signals):
gal.build() gal.build()
out_html = os.path.join(settings['destination'], out_html = os.path.join(settings['destination'],
'dir2', 'exo20101028-b-full.jpg.html') 'dir2', 'KeckObservatory20071020.jpg.html')
assert os.path.isfile(out_html) assert os.path.isfile(out_html)
for path, dirs, files in os.walk(os.path.join(str(tmpdir), "nomedia")): for path, dirs, files in os.walk(os.path.join(str(tmpdir), "nomedia")):

4
tests/test_utils.py

@ -6,7 +6,7 @@ SAMPLE_DIR = os.path.join(CURRENT_DIR, 'sample')
def test_copy(tmpdir): def test_copy(tmpdir):
filename = 'exo20101028-b-full.jpg' filename = 'KeckObservatory20071020.jpg'
src = os.path.join(SAMPLE_DIR, 'pictures', 'dir2', filename) src = os.path.join(SAMPLE_DIR, 'pictures', 'dir2', filename)
dst = str(tmpdir.join(filename)) dst = str(tmpdir.join(filename))
utils.copy(src, dst) utils.copy(src, dst)
@ -19,7 +19,7 @@ def test_copy(tmpdir):
assert os.path.islink(dst) assert os.path.islink(dst)
assert os.readlink(dst) == src assert os.readlink(dst) == src
filename = 'exo20101028-b-full.jpg' filename = 'KeckObservatory20071020.jpg'
src = os.path.join(SAMPLE_DIR, 'pictures', 'dir2', filename) src = os.path.join(SAMPLE_DIR, 'pictures', 'dir2', filename)
utils.copy(src, dst, symlink=True) utils.copy(src, dst, symlink=True)
assert os.path.islink(dst) assert os.path.islink(dst)

2
tests/test_video.py

@ -5,7 +5,7 @@ from sigal.video import video_size, generate_video, process_video
from sigal.settings import create_settings, Status from sigal.settings import create_settings, Status
CURRENT_DIR = os.path.dirname(__file__) CURRENT_DIR = os.path.dirname(__file__)
TEST_VIDEO = 'stallman software-freedom-day-low.ogv' TEST_VIDEO = 'example video.ogv'
SRCFILE = os.path.join(CURRENT_DIR, 'sample', 'pictures', 'video', TEST_VIDEO) SRCFILE = os.path.join(CURRENT_DIR, 'sample', 'pictures', 'video', TEST_VIDEO)

4
tests/test_zip.py

@ -29,9 +29,9 @@ def test_zipped_correctly(tmpdir):
assert os.path.basename(zipped1[0]) == 'archive.zip' assert os.path.basename(zipped1[0]) == 'archive.zip'
zip_file = zipfile.ZipFile(zipped1[0], 'r') zip_file = zipfile.ZipFile(zipped1[0], 'r')
expected = ('11.jpg', 'archlinux-kiss-1024x640.png', expected = ('11.jpg', 'CMB_Timeline300_no_WMAP.jpg',
'flickr_jerquiaga_2394751088_cc-by-nc.jpg', 'flickr_jerquiaga_2394751088_cc-by-nc.jpg',
'50a1d0bc-763d-457e-b634-c87f16a64270.gif') 'example.gif')
for filename in zip_file.namelist(): for filename in zip_file.namelist():
assert filename in expected assert filename in expected

Loading…
Cancel
Save