2010-07-30 11:20:43 -05:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
"""
|
|
|
|
test_websupport
|
|
|
|
~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
Test the Web Support Package
|
|
|
|
|
2017-03-22 06:21:12 -05:00
|
|
|
:copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS.
|
2010-07-30 11:20:43 -05:00
|
|
|
:license: BSD, see LICENSE for details.
|
|
|
|
"""
|
|
|
|
|
|
|
|
from sphinx.websupport import WebSupport
|
2010-08-21 15:47:32 -05:00
|
|
|
try:
|
|
|
|
sqlalchemy_missing = False
|
|
|
|
except ImportError:
|
|
|
|
sqlalchemy_missing = True
|
2010-07-30 11:20:43 -05:00
|
|
|
|
2017-01-03 07:24:00 -06:00
|
|
|
import pytest
|
2017-01-06 09:46:26 -06:00
|
|
|
from util import rootdir, tempdir
|
2010-07-30 11:20:43 -05:00
|
|
|
|
2010-07-30 16:13:51 -05:00
|
|
|
|
2017-04-22 03:43:26 -05:00
|
|
|
@pytest.mark.skipif(sqlalchemy_missing, reason='needs sqlalchemy')
|
|
|
|
def test_build(request):
|
2017-01-03 07:24:00 -06:00
|
|
|
settings = {
|
2017-04-22 03:43:26 -05:00
|
|
|
'srcdir': rootdir / 'roots' / 'test-basic',
|
2017-01-03 07:24:00 -06:00
|
|
|
# to use same directory for 'builddir' in each 'support' fixture, using
|
|
|
|
# 'tempdir' (static) value instead of 'tempdir' fixture value.
|
|
|
|
# each test expect result of db value at previous test case.
|
|
|
|
'builddir': tempdir / 'websupport'
|
|
|
|
}
|
|
|
|
marker = request.node.get_marker('support')
|
|
|
|
if marker:
|
|
|
|
settings.update(marker.kwargs)
|
2010-08-04 13:09:07 -05:00
|
|
|
|
2017-01-03 07:24:00 -06:00
|
|
|
support = WebSupport(**settings)
|
2010-07-30 11:20:43 -05:00
|
|
|
support.build()
|