diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2012-02-12 18:42:17 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2012-02-12 20:17:54 +0100 |
commit | 2d66d16af09239d285d572b9e3749b0132b69f99 (patch) | |
tree | 388232f65c51e5640202de3c115a2a823094504b | |
parent | a0fb7211cde25748e76f615b8fd8254dec947e2c (diff) | |
download | samba-2d66d16af09239d285d572b9e3749b0132b69f99.tar.gz samba-2d66d16af09239d285d572b9e3749b0132b69f99.tar.bz2 samba-2d66d16af09239d285d572b9e3749b0132b69f99.zip |
wafsamba: Add tests for dict_concat.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sun Feb 12 20:17:54 CET 2012 on sn-devel-104
-rw-r--r-- | buildtools/wafsamba/tests/test_utils.py | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/buildtools/wafsamba/tests/test_utils.py b/buildtools/wafsamba/tests/test_utils.py index c40f71eaad..a9578e25ae 100644 --- a/buildtools/wafsamba/tests/test_utils.py +++ b/buildtools/wafsamba/tests/test_utils.py @@ -18,6 +18,7 @@ from wafsamba.tests import TestCase from wafsamba.samba_utils import ( TO_LIST, + dict_concat, subst_vars_error, unique_list, ) @@ -50,8 +51,26 @@ class UniqueListTests(TestCase): class SubstVarsErrorTests(TestCase): def test_valid(self): - self.assertEquals("", subst_vars_error("")) + self.assertEquals("", subst_vars_error("", {})) self.assertEquals("FOO bar", subst_vars_error("${F} bar", {"F": "FOO"})) def test_invalid(self): self.assertRaises(KeyError, subst_vars_error, "${F}", {}) + + +class DictConcatTests(TestCase): + + def test_empty(self): + ret = {} + dict_concat(ret, {}) + self.assertEquals({}, ret) + + def test_same(self): + ret = {"foo": "bar"} + dict_concat(ret, {"foo": "bla"}) + self.assertEquals({"foo": "bar"}, ret) + + def test_simple(self): + ret = {"foo": "bar"} + dict_concat(ret, {"blie": "bla"}) + self.assertEquals({"foo": "bar", "blie": "bla"}, ret) |