mirror of https://github.com/saimn/sigal.git
7 changed files with 84 additions and 45 deletions
@ -1,27 +0,0 @@
|
||||
# -*- coding:utf-8 -*- |
||||
|
||||
import os |
||||
|
||||
from sigal.gallery import Gallery |
||||
from sigal import init_plugins |
||||
|
||||
CURRENT_DIR = os.path.dirname(__file__) |
||||
|
||||
def test_nomedia_plugin(settings, tmpdir): |
||||
|
||||
settings['destination'] = str(tmpdir) |
||||
if "plugins"in settings: |
||||
if not "sigal.plugins.nomedia" in settings["plugins"]: |
||||
settings['plugins'] += ["sigal.plugins.nomedia"] |
||||
else: |
||||
settings["plugins"] = ["sigal.plugins.nomedia"] |
||||
|
||||
init_plugins(settings) |
||||
gal = Gallery(settings) |
||||
gal.build() |
||||
|
||||
for path, dirs, files in os.walk(os.path.join(str(tmpdir), "nomedia")): |
||||
assert "ignore" not in path |
||||
|
||||
for file in files: |
||||
assert "ignore" not in file |
||||
@ -0,0 +1,31 @@
|
||||
# -*- coding:utf-8 -*- |
||||
|
||||
import os |
||||
|
||||
from sigal.gallery import Gallery |
||||
from sigal import init_plugins |
||||
|
||||
CURRENT_DIR = os.path.dirname(__file__) |
||||
|
||||
|
||||
def test_plugins(settings, tmpdir): |
||||
|
||||
settings['destination'] = str(tmpdir) |
||||
if "sigal.plugins.nomedia" not in settings["plugins"]: |
||||
settings['plugins'] += ["sigal.plugins.nomedia"] |
||||
if "sigal.plugins.media_page" not in settings["plugins"]: |
||||
settings['plugins'] += ["sigal.plugins.media_page"] |
||||
|
||||
init_plugins(settings) |
||||
gal = Gallery(settings) |
||||
gal.build() |
||||
|
||||
out_html = os.path.join(settings['destination'], |
||||
'dir2', 'exo20101028-b-full.jpg.html') |
||||
assert os.path.isfile(out_html) |
||||
|
||||
for path, dirs, files in os.walk(os.path.join(str(tmpdir), "nomedia")): |
||||
assert "ignore" not in path |
||||
|
||||
for file in files: |
||||
assert "ignore" not in file |
||||
Loading…
Reference in new issue