diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2012-03-04 02:28:06 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2012-03-04 18:02:06 +0100 |
commit | c57ab7ba9d7e25ac18d1e9883d3fc86a688fa7be (patch) | |
tree | 146d30702ceffc37a9714da346d89d60cc33fcac /selftest/target | |
parent | 5f74fa3511f0a545b63db142741320fc38126646 (diff) | |
download | samba-c57ab7ba9d7e25ac18d1e9883d3fc86a688fa7be.tar.gz samba-c57ab7ba9d7e25ac18d1e9883d3fc86a688fa7be.tar.bz2 samba-c57ab7ba9d7e25ac18d1e9883d3fc86a688fa7be.zip |
selftest.target: Add tests for setup.
Diffstat (limited to 'selftest/target')
-rw-r--r-- | selftest/target/__init__.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/selftest/target/__init__.py b/selftest/target/__init__.py index 03a440dd27..ac2cc19a48 100644 --- a/selftest/target/__init__.py +++ b/selftest/target/__init__.py @@ -91,13 +91,15 @@ class EnvironmentManager(object): def get_running_env(self, name): envname = name.split(":")[0] - return self.running_envs[envname] + if envname == "none": + return NoneEnvironment() + return self.running_envs.get(envname) def getlog_env(self, envname): env = self.get_running_env(envname) return env.get_log() - def check_env(envname): + def check_env(self, envname): """Check if an environment is still up. :param envname: Environment to check @@ -115,13 +117,11 @@ class EnvironmentManager(object): del self.running_envs[envname] def teardown_all(self): + """Teardown all environments.""" for env in self.running_envs.iterkeys(): self.teardown_env(env) def setup_env(self, envname, prefix): - if envname == "none": - return NoneEnvironment() - running_env = self.get_running_env(envname) if running_env is not None: if not running_env.check(): |