selftest.target: Add tests for get_running_env.
authorJelmer Vernooij <jelmer@samba.org>
Sun, 4 Mar 2012 01:31:32 +0000 (02:31 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Sun, 4 Mar 2012 17:02:06 +0000 (18:02 +0100)
selftest/tests/test_target.py

index c75f0cd..d29bd66 100644 (file)
@@ -79,3 +79,10 @@ class EnvironmentManagerTests(unittest.TestCase):
         env.log_ret = 'bla'
         self.assertEquals('bla', env.get_log())
         self.assertEquals('bla', self.mgr.getlog_env("something"))
+
+    def test_get_running_env(self):
+        env = self.mgr.setup_env("something", "prefix")
+        self.assertIs(env, self.mgr.get_running_env("something"))
+
+    def test_get_running_env_nonexistant(self):
+        self.assertIs(None, self.mgr.get_running_env("something"))