summaryrefslogtreecommitdiff
path: root/selftest/tests
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2012-03-04 02:28:06 +0100
committerJelmer Vernooij <jelmer@samba.org>2012-03-04 18:02:06 +0100
commitc57ab7ba9d7e25ac18d1e9883d3fc86a688fa7be (patch)
tree146d30702ceffc37a9714da346d89d60cc33fcac /selftest/tests
parent5f74fa3511f0a545b63db142741320fc38126646 (diff)
downloadsamba-c57ab7ba9d7e25ac18d1e9883d3fc86a688fa7be.tar.gz
samba-c57ab7ba9d7e25ac18d1e9883d3fc86a688fa7be.tar.bz2
samba-c57ab7ba9d7e25ac18d1e9883d3fc86a688fa7be.zip
selftest.target: Add tests for setup.
Diffstat (limited to 'selftest/tests')
-rw-r--r--selftest/tests/test_target.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/selftest/tests/test_target.py b/selftest/tests/test_target.py
index 9b3d37b270..343de930cb 100644
--- a/selftest/tests/test_target.py
+++ b/selftest/tests/test_target.py
@@ -26,7 +26,6 @@ from selftest.target import (
Target,
)
-import os
import unittest
@@ -47,8 +46,8 @@ class DummyEnvironment(Environment):
class DummyTarget(Target):
- def get_target(self, name, prefix):
- return DummyTarget(name, prefix)
+ def setup_env(self, name, prefix):
+ return DummyEnvironment(name, prefix)
class EnvironmentManagerTests(unittest.TestCase):
@@ -57,4 +56,10 @@ class EnvironmentManagerTests(unittest.TestCase):
self.mgr = EnvironmentManager(DummyTarget())
def test_none(self):
- self.assertIs(NoneEnvironment, type(self.mgr.setup_env("none", "prefix")))
+ self.assertIs(
+ NoneEnvironment, type(self.mgr.setup_env("none", "prefix")))
+
+ def test_setup(self):
+ env = self.mgr.setup_env("something", "prefix")
+ self.assertEquals(env.name, "something")
+ self.assertEquals(env.prefix, "prefix")