summaryrefslogtreecommitdiff
path: root/buildtools
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2012-02-12 18:42:17 +0100
committerJelmer Vernooij <jelmer@samba.org>2012-02-12 20:17:54 +0100
commit2d66d16af09239d285d572b9e3749b0132b69f99 (patch)
tree388232f65c51e5640202de3c115a2a823094504b /buildtools
parenta0fb7211cde25748e76f615b8fd8254dec947e2c (diff)
downloadsamba-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
Diffstat (limited to 'buildtools')
-rw-r--r--buildtools/wafsamba/tests/test_utils.py21
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)