summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2012-03-04 02:37:42 +0100
committerJelmer Vernooij <jelmer@samba.org>2012-03-04 18:02:06 +0100
commit646f6b2697147ebabe5ee985b13964d5e3f33ae1 (patch)
tree171739545da0f9994385f43432c00e8c84e4fd04
parent7060d68015b102fe3109683b387bd2218d9473d8 (diff)
downloadsamba-646f6b2697147ebabe5ee985b13964d5e3f33ae1.tar.gz
samba-646f6b2697147ebabe5ee985b13964d5e3f33ae1.tar.bz2
samba-646f6b2697147ebabe5ee985b13964d5e3f33ae1.zip
selftest: Add tests for trying to reuse an environment that has gone down.
-rw-r--r--selftest/tests/test_target.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/selftest/tests/test_target.py b/selftest/tests/test_target.py
index 6236dcbec9..0a5d1c4310 100644
--- a/selftest/tests/test_target.py
+++ b/selftest/tests/test_target.py
@@ -20,9 +20,10 @@
"""Tests for selftest.target."""
from selftest.target import (
+ Environment,
+ EnvironmentDown,
EnvironmentManager,
NoneEnvironment,
- Environment,
Target,
)
@@ -86,6 +87,11 @@ class EnvironmentManagerTests(unittest.TestCase):
env2 = self.mgr.setup_env("something", "prefix")
self.assertIs(env1, env2)
+ def test_setup_down(self):
+ env1 = self.mgr.setup_env("something", "prefix")
+ env1.check_ret = False
+ self.assertRaises(EnvironmentDown, self.mgr.setup_env, "something", "")
+
def test_check(self):
env = self.mgr.setup_env("something", "prefix")
self.assertTrue(env.check())