Add a test for deprecated default bindings.

This commit is contained in:
Florian Bruhin 2015-05-13 08:26:19 +02:00
parent a93bf184aa
commit 25005ded8a

View File

@ -157,6 +157,14 @@ class TestConfigParser:
self.cfg.get('general', 'bar') # pylint: disable=bad-config-call
def keyconfig_deprecated_test_cases():
"""Generator yielding test cases (command, rgx) for TestKeyConfigParser."""
for sect in configdata.KEY_DATA.values():
for command in sect:
for rgx, _repl in configdata.CHANGED_KEY_COMMANDS:
yield (command, rgx)
class TestKeyConfigParser:
"""Test config.parsers.keyconf.KeyConfigParser."""
@ -177,6 +185,11 @@ class TestKeyConfigParser:
with pytest.raises(keyconf.KeyConfigError):
kcp._read_command(cmdline_test.cmd)
@pytest.mark.parametrize('command, rgx', keyconfig_deprecated_test_cases())
def test_default_config_no_deprecated(self, command, rgx):
"""Make sure the default config contains no deprecated commands."""
assert rgx.match(command) is None
class TestDefaultConfig: