summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2012-03-04 02:29:34 +0100
committerJelmer Vernooij <jelmer@samba.org>2012-03-04 18:02:06 +0100
commite7633d86c03c57b6fc8a4e5b4a26f7e9159c6ec7 (patch)
treeff9287f54583136da6f12feca6d67ccae51becfb
parentc57ab7ba9d7e25ac18d1e9883d3fc86a688fa7be (diff)
downloadsamba-e7633d86c03c57b6fc8a4e5b4a26f7e9159c6ec7.tar.gz
samba-e7633d86c03c57b6fc8a4e5b4a26f7e9159c6ec7.tar.bz2
samba-e7633d86c03c57b6fc8a4e5b4a26f7e9159c6ec7.zip
selftest.target: Add tests for check.
-rw-r--r--selftest/target/__init__.py3
-rw-r--r--selftest/tests/test_target.py8
2 files changed, 9 insertions, 2 deletions
diff --git a/selftest/target/__init__.py b/selftest/target/__init__.py
index ac2cc19a48..72e0770d92 100644
--- a/selftest/target/__init__.py
+++ b/selftest/target/__init__.py
@@ -128,11 +128,10 @@ class EnvironmentManager(object):
raise EnvironmentDown(running_env.get_log())
return running_env
-
env = self.target.setup_env(envname, prefix)
if env is None:
return None
- self.running_envs[env] = env
+ self.running_envs[envname] = env
return env
diff --git a/selftest/tests/test_target.py b/selftest/tests/test_target.py
index 343de930cb..0abc79b6bb 100644
--- a/selftest/tests/test_target.py
+++ b/selftest/tests/test_target.py
@@ -63,3 +63,11 @@ class EnvironmentManagerTests(unittest.TestCase):
env = self.mgr.setup_env("something", "prefix")
self.assertEquals(env.name, "something")
self.assertEquals(env.prefix, "prefix")
+
+ def test_check(self):
+ env = self.mgr.setup_env("something", "prefix")
+ self.assertTrue(env.check())
+ self.assertTrue(self.mgr.check_env("something"))
+ env.check_ret = False
+ self.assertFalse(env.check())
+ self.assertFalse(self.mgr.check_env("something"))