diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2012-03-05 03:49:50 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2012-03-05 03:49:50 +0100 |
commit | f26b40a92553863bc0da39918ff19bf21199c608 (patch) | |
tree | 83ceb362eb82d71880a54e694e93b1498aae04fb /selftest/tests | |
parent | a6a84566466a59fc954268ebd616ef1af4b347b1 (diff) | |
download | samba-f26b40a92553863bc0da39918ff19bf21199c608.tar.gz samba-f26b40a92553863bc0da39918ff19bf21199c608.tar.bz2 samba-f26b40a92553863bc0da39918ff19bf21199c608.zip |
selftest.run: Factor out exported_envvars_str.
Diffstat (limited to 'selftest/tests')
-rw-r--r-- | selftest/tests/test_run.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/selftest/tests/test_run.py b/selftest/tests/test_run.py index f1ce4bc9de..894ceaa7fc 100644 --- a/selftest/tests/test_run.py +++ b/selftest/tests/test_run.py @@ -25,6 +25,7 @@ from selftest.run import ( expand_command_list, expand_environment_strings, expand_command_run, + exported_envvars_str, ) from selftest.tests import TestCase @@ -77,3 +78,17 @@ class ExpandCommandRunTests(TestCase): def test_loadlist_all(self): self.assertEquals(("test ", None), expand_command_run("test $LOADLIST", True, False)) + + +class ExportedEnvvarsStrTests(TestCase): + + def test_no_vars(self): + self.assertEquals("", exported_envvars_str({}, ["foo", "bar"])) + + def test_vars(self): + self.assertEquals("foo=1\n", + exported_envvars_str({"foo": "1"}, ["foo", "bar"])) + + def test_vars_unknown(self): + self.assertEquals("foo=1\n", + exported_envvars_str({"foo": "1", "bla": "2"}, ["foo", "bar"])) |