From 25005ded8a415864ae7c2dda96ae64fb1e4fe7fa Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 13 May 2015 08:26:19 +0200 Subject: [PATCH] Add a test for deprecated default bindings. --- tests/config/test_config.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/config/test_config.py b/tests/config/test_config.py index 383fed232..edca7ae0d 100644 --- a/tests/config/test_config.py +++ b/tests/config/test_config.py @@ -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: