From a97d61df040111b9ce4585db262ddfaba24df4da Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Tue, 2 Dec 2014 15:52:41 +0100 Subject: test_integration: Parametrize test instead of using a generator Reviewed-By: Tomas Babej --- ipatests/test_integration/test_caless.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'ipatests') diff --git a/ipatests/test_integration/test_caless.py b/ipatests/test_integration/test_caless.py index d0263a9c9..426a4ad54 100644 --- a/ipatests/test_integration/test_caless.py +++ b/ipatests/test_integration/test_caless.py @@ -24,6 +24,7 @@ import base64 import glob import contextlib import nose +import pytest from ipalib import x509 from ipapython import ipautil @@ -1167,18 +1168,16 @@ class TestIPACommands(CALessBase): result = self.master.run_command(['ipa', command], raiseonerr=False) assert_error(result, "ipa: ERROR: unknown command '%s'" % command) - def test_cert_commands_unavailable(self): - for cmd in ( - 'cert-status', - 'cert-show', - 'cert-find', - 'cert-revoke', - 'cert-remove-hold', - 'cert-status'): - func = lambda: self.check_ipa_command_not_available(cmd) - func.description = 'Verify that %s command is not available' % cmd - func.test_argument = cmd - yield (func, ) + @pytest.mark.parametrize('command', ( + 'cert-status', + 'cert-show', + 'cert-find', + 'cert-revoke', + 'cert-remove-hold', + 'cert-status')) + def test_cert_commands_unavailable(self, command): + result = self.master.run_command(['ipa', command], raiseonerr=False) + assert_error(result, "ipa: ERROR: unknown command '%s'" % command) def test_cert_help_unavailable(self): "Verify that cert plugin help is not available" -- cgit