diff options
-rw-r--r-- | selftest/target/__init__.py | 3 | ||||
-rw-r--r-- | selftest/tests/test_target.py | 8 |
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")) |