Add sphinx.config.ENUM to check the config values is in candidates

This commit is contained in:
Takeshi KOMIYA
2016-07-03 23:55:15 +09:00
parent d984852908
commit 5991bbe4ac
4 changed files with 46 additions and 12 deletions

View File

@@ -206,3 +206,15 @@ def test_gen_check_types(app, status, warning):
'override on "%s" should%s raise a type warning' %
(key, '' if should else ' NOT')
)
@with_app(testroot='config')
def test_check_enum(app, status, warning):
assert "The config value `value17` has to be a one of ('default', 'one', 'two'), " \
not in warning.getvalue()
@with_app(testroot='config', confoverrides={'value17': 'invalid'})
def test_check_enum_failed(app, status, warning):
assert "The config value `value17` has to be a one of ('default', 'one', 'two'), " \
"but `invalid` is given." in warning.getvalue()