summaryrefslogtreecommitdiffstats
path: root/ipatests
diff options
context:
space:
mode:
authorTomas Babej <tbabej@redhat.com>2014-12-15 18:42:45 +0100
committerPetr Viktorin <pviktori@redhat.com>2014-12-16 12:20:44 +0100
commitb7e58ce74623c5bb52ce7c74c4242dfda3786a3a (patch)
tree6394b10645887d1ac64e4be0c2a64217cc9f411e /ipatests
parentad01a6b5c5591b03f8cf247343e6783b9b99903e (diff)
downloadfreeipa-b7e58ce74623c5bb52ce7c74c4242dfda3786a3a.tar.gz
freeipa-b7e58ce74623c5bb52ce7c74c4242dfda3786a3a.tar.xz
freeipa-b7e58ce74623c5bb52ce7c74c4242dfda3786a3a.zip
ipatests: Refactor and fix docstrings in integration pytest plugin
https://fedorahosted.org/freeipa/ticket/4809 Reviewed-By: Petr Viktorin <pviktori@redhat.com>
Diffstat (limited to 'ipatests')
-rw-r--r--ipatests/pytest_plugins/integration.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/ipatests/pytest_plugins/integration.py b/ipatests/pytest_plugins/integration.py
index 3bd9d6e05..1dddf5b8c 100644
--- a/ipatests/pytest_plugins/integration.py
+++ b/ipatests/pytest_plugins/integration.py
@@ -179,7 +179,7 @@ def mh(request, class_integration_logs):
config_class=Config,
_config=get_global_config(),
)
- config = mh.config
+
mh.domain = mh.config.domains[0]
[mh.master] = mh.domain.hosts_by_role('master')
mh.replicas = mh.domain.hosts_by_role('replica')
@@ -192,13 +192,13 @@ def mh(request, class_integration_logs):
(host.external_hostname, filename))
class_integration_logs.setdefault(host, []).append(filename)
- print config
- for host in config.get_all_hosts():
+ print mh.config
+ for host in mh.config.get_all_hosts():
host.add_log_collector(collect_log)
cls.log.info('Preparing host %s', host.hostname)
tasks.prepare_host(host)
- setup_class(cls, config)
+ setup_class(cls, mh)
mh._pytestmh_request.addfinalizer(lambda: teardown_class(cls))
yield mh.install()
@@ -209,21 +209,21 @@ def mh(request, class_integration_logs):
collect_test_logs(request.node, class_integration_logs, request.config)
-def setup_class(cls, config):
- """Add convenience addributes to the test class
+def setup_class(cls, mh):
+ """Add convenience attributes to the test class
This is deprecated in favor of the mh fixture.
To be removed when no more tests using this.
"""
- cls.domain = config.domains[0]
- cls.master = cls.domain.master
- cls.replicas = cls.domain.replicas
- cls.clients = cls.domain.clients
- cls.ad_domains = config.ad_domains
+ cls.domain = mh.domain
+ cls.master = mh.master
+ cls.replicas = mh.replicas
+ cls.clients = mh.clients
+ cls.ad_domains = mh.config.ad_domains
def teardown_class(cls):
- """Add convenience addributes to the test class
+ """Remove convenience attributes from the test class
This is deprecated in favor of the mh fixture.
To be removed when no more tests using this.