From aa7fa63bfaf0757ac4ff4112825333fb4524ce95 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 4 Mar 2012 02:32:26 +0100 Subject: selftest.target: Test that environments are reused. --- selftest/tests/test_target.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'selftest/tests') diff --git a/selftest/tests/test_target.py b/selftest/tests/test_target.py index d29bd66cda..573b65db0a 100644 --- a/selftest/tests/test_target.py +++ b/selftest/tests/test_target.py @@ -64,6 +64,11 @@ class EnvironmentManagerTests(unittest.TestCase): self.assertEquals(env.name, "something") self.assertEquals(env.prefix, "prefix") + def test_setup_reuses(self): + env1 = self.mgr.setup_env("something", "prefix") + env2 = self.mgr.setup_env("something", "prefix") + self.assertIs(env1, env2) + def test_check(self): env = self.mgr.setup_env("something", "prefix") self.assertTrue(env.check()) -- cgit