On 02/11/2016 10:00 AM, Martin Babinsky wrote:
On 02/09/2016 04:06 PM, Milan Kubík wrote:
On 02/09/2016 02:37 PM, Milan Kubík wrote:
Fixes the CA ACL tests broken by removed import. This patch doesn't
rely on undocumented behavior of pytest.

The patch invalidates patch 133 by Martin Babinsky.

Patch updated with trac link

Milan Kubik

ACK I guess, although copypasta makes me very sad.

Why do you think the conftest.py approach is not practical for us?

I think introducing new file to hold shared fixtures is not worth managing it and it also hides (by the virtue of pytest's working) from where the fixture comes. I think it is better in our case to have all fixtures the test uses in its module, even though it looks like copy-pasting. If I had renamed the entry for the test only, would it still been considered copy-paste?

Anyway, patch for ipa-4-3 attached.

Milan Kubik

From 7615c5ca6bed0392d1483840c828119eff4306f1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Milan=20Kub=C3=ADk?= <mku...@redhat.com>
Date: Tue, 2 Feb 2016 11:34:26 +0100
Subject: [PATCH] ipatests: Add missing certificate profile fixture

 ipatests/test_xmlrpc/test_caacl_plugin.py | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/ipatests/test_xmlrpc/test_caacl_plugin.py b/ipatests/test_xmlrpc/test_caacl_plugin.py
index d5ded19516ec917bcb2e90034b4fac8a6324b2e9..f20b02b295024313008be7b75bdcae2ade70b4ff 100644
--- a/ipatests/test_xmlrpc/test_caacl_plugin.py
+++ b/ipatests/test_xmlrpc/test_caacl_plugin.py
@@ -11,13 +11,21 @@ import pytest
 from ipalib import errors
 from ipatests.test_xmlrpc.xmlrpc_test import XMLRPC_test
-# reuse the fixture
-from ipatests.test_xmlrpc.test_certprofile_plugin import default_profile
+from ipatests.test_xmlrpc.tracker.certprofile_plugin import CertprofileTracker
 from ipatests.test_xmlrpc.tracker.caacl_plugin import CAACLTracker
 from ipatests.test_xmlrpc.tracker.stageuser_plugin import StageUserTracker
+def default_profile(request):
+    name = 'caIPAserviceCert'
+    desc = u'Standard profile for network services'
+    tracker = CertprofileTracker(name, store=True, desc=desc)
+    tracker.track_create()
+    return tracker
 def default_acl(request):
     name = u'hosts_services_caIPAserviceCert'
     tracker = CAACLTracker(name, service_category=u'all', host_category=u'all')

Manage your subscription for the Freeipa-devel mailing list:
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to