[Checkins] SVN: zope.configuration/branches/tseaver-test_cleanup/src/zope/configuration/tests/test_config.py Full coverage for z.c.config.expand_action.

Tres Seaver cvs-admin at zope.org
Wed May 9 20:23:26 UTC 2012


Log message for revision 125777:
  Full coverage for z.c.config.expand_action.

Changed:
  U   zope.configuration/branches/tseaver-test_cleanup/src/zope/configuration/tests/test_config.py

-=-
Modified: zope.configuration/branches/tseaver-test_cleanup/src/zope/configuration/tests/test_config.py
===================================================================
--- zope.configuration/branches/tseaver-test_cleanup/src/zope/configuration/tests/test_config.py	2012-05-09 20:23:19 UTC (rev 125776)
+++ zope.configuration/branches/tseaver-test_cleanup/src/zope/configuration/tests/test_config.py	2012-05-09 20:23:23 UTC (rev 125777)
@@ -1706,6 +1706,51 @@
         from zope.configuration.config import expand_action
         return expand_action(*args, **kw)
 
+    def test_defaults(self):
+        self.assertEqual(self._callFUT(('a', 1, None)),
+                         {'discriminator': ('a', 1, None),
+                          'callable': None,
+                          'args': (),
+                          'kw': {},
+                          'includepath': (),
+                          'info': None,
+                          'order': 0,
+                         })
+
+    def test_explicit_no_extra(self):
+        def _callable():
+            pass
+        self.assertEqual(self._callFUT(('a', 1, None),
+                                       _callable, ('b', 2), {'c': None},
+                                       ('p', 'q/r'), 'INFO', 42,
+                                      ),
+                         {'discriminator': ('a', 1, None),
+                          'callable': _callable,
+                          'args': ('b', 2),
+                          'kw': {'c': None},
+                          'includepath': ('p', 'q/r'),
+                          'info': 'INFO',
+                          'order': 42,
+                         })
+
+    def test_explicit_w_extra(self):
+        def _callable():
+            pass
+        self.assertEqual(self._callFUT(('a', 1, None),
+                                       _callable, ('b', 2), {'c': None},
+                                       ('p', 'q/r'), 'INFO', 42,
+                                       foo='bar', baz=None,
+                                      ),
+                         {'discriminator': ('a', 1, None),
+                          'callable': _callable,
+                          'args': ('b', 2),
+                          'kw': {'c': None},
+                          'includepath': ('p', 'q/r'),
+                          'info': 'INFO',
+                          'order': 42,
+                          'foo': 'bar',
+                          'baz': None,
+                         })
     #TODO coverage
 
 



More information about the checkins mailing list