1 # test_run.py -- Tests for selftest.run
2 # Copyright (C) 2012 Jelmer Vernooij <jelmer@samba.org>
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; version 3
7 # of the License or (at your option) any later version of
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
20 """Tests for selftest.run."""
22 from selftest.run import (
24 expand_environment_strings,
27 from selftest.tests import TestCase
30 class ExpandEnvironmentStringsTests(TestCase):
32 def test_no_vars(self):
33 self.assertEquals("foo bar", expand_environment_strings("foo bar", {}))
35 def test_simple(self):
36 self.assertEquals("foo bar",
37 expand_environment_strings("foo $BLA", {"BLA": "bar"}))
39 def test_unknown(self):
40 self.assertEquals("foo $BLA",
41 expand_environment_strings("foo $BLA", {}))
44 class ExpandCommandListTests(TestCase):
46 def test_no_list(self):
47 self.assertIs(None, expand_command_list("test bla"))
50 self.assertEquals("test --list", expand_command_list("test $LISTOPT"))