mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-08-19 01:15:06 -05:00
pytest: Migrate xunit-style setups to Pytest fixtures
Even though Pytest supports xunit style setups, unittest and nose tests, this support is limited and may be dropped in the future releases. Worst of all is that the mixing of various test frameworks results in weird conflicts and of course, is not widely tested. This is a part of work to remove the mixing of test idioms in the IPA's test suite: 1) replace xunit style 2) employ the fixtures' interdependencies Related: https://pagure.io/freeipa/issue/7989 Signed-off-by: Stanislav Levin <slev@altlinux.org> Reviewed-By: Christian Heimes <cheimes@redhat.com>
This commit is contained in:
committed by
Alexander Bokovoy
parent
ff547a2777
commit
292d686c0b
@@ -18,7 +18,7 @@ from ipatests.test_xmlrpc.tracker.ca_plugin import CATracker
|
||||
|
||||
|
||||
@pytest.fixture(scope='class')
|
||||
def default_profile(request):
|
||||
def default_profile(request, xmlrpc_setup):
|
||||
name = 'caIPAserviceCert'
|
||||
desc = u'Standard profile for network services'
|
||||
tracker = CertprofileTracker(name, store=True, desc=desc)
|
||||
@@ -27,7 +27,7 @@ def default_profile(request):
|
||||
|
||||
|
||||
@pytest.fixture(scope='class')
|
||||
def default_acl(request):
|
||||
def default_acl(request, xmlrpc_setup):
|
||||
name = u'hosts_services_caIPAserviceCert'
|
||||
tracker = CAACLTracker(name, service_category=u'all', host_category=u'all')
|
||||
tracker.track_create()
|
||||
@@ -37,7 +37,7 @@ def default_acl(request):
|
||||
|
||||
|
||||
@pytest.fixture(scope='class')
|
||||
def crud_acl(request):
|
||||
def crud_acl(request, xmlrpc_setup):
|
||||
name = u'crud-acl'
|
||||
tracker = CAACLTracker(name)
|
||||
|
||||
@@ -45,7 +45,7 @@ def crud_acl(request):
|
||||
|
||||
|
||||
@pytest.fixture(scope='class')
|
||||
def category_acl(request):
|
||||
def category_acl(request, xmlrpc_setup):
|
||||
name = u'category_acl'
|
||||
tracker = CAACLTracker(name, ipacertprofile_category=u'all',
|
||||
user_category=u'all', service_category=u'all',
|
||||
@@ -55,14 +55,14 @@ def category_acl(request):
|
||||
|
||||
|
||||
@pytest.fixture(scope='class')
|
||||
def caacl_test_ca(request):
|
||||
def caacl_test_ca(request, xmlrpc_setup):
|
||||
name = u'caacl-test-ca'
|
||||
subject = u'CN=caacl test subca,O=test industries inc.'
|
||||
return CATracker(name, subject).make_fixture(request)
|
||||
|
||||
|
||||
@pytest.fixture(scope='class')
|
||||
def staged_user(request):
|
||||
def staged_user(request, xmlrpc_setup):
|
||||
name = u'st-user'
|
||||
tracker = StageUserTracker(name, u'stage', u'test')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user