From a93bdcc4c7e30262932bd9b229324fbcedd63b9c Mon Sep 17 00:00:00 2001 From: Simon Conseil Date: Sat, 30 Jan 2016 23:44:24 +0100 Subject: [PATCH] Test that exception is raised in debug mode. --- tests/test_gallery.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_gallery.py b/tests/test_gallery.py index 066a739..865eceb 100644 --- a/tests/test_gallery.py +++ b/tests/test_gallery.py @@ -1,12 +1,14 @@ # -*- coding:utf-8 -*- import locale +import logging import os import pytest import datetime from os.path import join from sigal.gallery import Album, Media, Image, Video, Gallery +from sigal.video import SubprocessException CURRENT_DIR = os.path.dirname(__file__) @@ -218,6 +220,8 @@ def test_gallery(settings, tmpdir): "Test the Gallery class." settings['destination'] = str(tmpdir) + settings['webm_options'] = ['-missing-option', 'foobar'] + gal = Gallery(settings, ncpu=1) gal.build() @@ -229,6 +233,11 @@ def test_gallery(settings, tmpdir): assert 'Sigal test gallery' in html + logging.getLogger('sigal').setLevel(logging.DEBUG) + gal = Gallery(settings, ncpu=1) + with pytest.raises(SubprocessException): + gal.build() + def test_empty_dirs(settings): gal = Gallery(settings, ncpu=1)