[mousetrap/gnome3-wip: 229/240] Start test_config.py. Add test for _rmerge.
- From: Heidi Ellis <heidiellis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mousetrap/gnome3-wip: 229/240] Start test_config.py. Add test for _rmerge.
- Date: Mon, 8 Sep 2014 15:31:49 +0000 (UTC)
commit 5e78abf429cb988b011cf1ea60a1dc42e03fb600
Author: Stoney Jackson <dr stoney gmail com>
Date: Mon Jun 30 18:28:15 2014 -0400
Start test_config.py. Add test for _rmerge.
src/mousetrap/tests/test_config.py | 28 ++++++++++++++++++++++++++++
1 files changed, 28 insertions(+), 0 deletions(-)
---
diff --git a/src/mousetrap/tests/test_config.py b/src/mousetrap/tests/test_config.py
new file mode 100644
index 0000000..0cd2b5e
--- /dev/null
+++ b/src/mousetrap/tests/test_config.py
@@ -0,0 +1,28 @@
+import unittest
+from mousetrap.config import _rmerge
+
+
+class test__rmerge(unittest.TestCase):
+
+ def setUp(self):
+ self.a = {
+ 'red': 1,
+ 'white': ['washington', [2, 3], {'lincoln': 4}],
+ 'blue': {'alpha': 5, 'list': [6, 7], 'dict': {'charlie' : 8}},
+ }
+
+ self.b = {
+ 'new': 9,
+ 'white': ['replacement'],
+ 'blue': {'new': 10, 'dict': {'charlie': 11, 'new': 12, 'newdict': {'some':'dict'}}},
+ }
+ self.ab = {
+ 'new': 9,
+ 'red': 1,
+ 'white': ['replacement'],
+ 'blue': {'new': 10, 'alpha': 5, 'list': [6, 7], 'dict': {'charlie' : 11, 'new': 12, 'newdict':
{'some':'dict'}}},
+ }
+
+ def test__rmerge(self):
+ _rmerge(self.a, self.b)
+ self.assertEqual(self.ab, self.a)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]