[test] add test for dict_translate()
authorNicolas Chauvat <nicolas.chauvat@logilab.fr>
Thu, 01 Jul 2010 17:07:08 +0200
changeset 14 1ab89b184151
parent 13 2144e28c8b28
child 15 c6477e1537bf
[test] add test for dict_translate()
test/test_cmcic.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/test_cmcic.py	Thu Jul 01 17:07:08 2010 +0200
@@ -0,0 +1,11 @@
+from logilab.common import testlib
+
+from cubes.cmcicpay import cmcic
+
+class DictTranslateTC(testlib.TestCase):
+
+    def test_dicttranslate(self):
+        msg = {'one':'oui', 'two': 'non', 'three': 'trois'}
+        map = {'one':'un', 'three': None}
+        result = cmcic.dict_translate(msg, map)
+        self.assertEquals(result, {'un': 'oui', 'two': 'non'})