[Zope3-checkins] CVS: Zope3/src/zope/configuration/tests - test_config.py:1.2

Jim Fulton jim@zope.com
Tue, 29 Jul 2003 15:56:49 -0400


Update of /cvs-repository/Zope3/src/zope/configuration/tests
In directory cvs.zope.org:/tmp/cvs-serv16659/src/zope/configuration/tests

Modified Files:
	test_config.py 
Log Message:
Added a check for trailing dots in dotted names.
These are no longer allowed. We were giving a cryptic
import error.  I also added a check for empty names.


=== Zope3/src/zope/configuration/tests/test_config.py 1.1 => 1.2 ===
--- Zope3/src/zope/configuration/tests/test_config.py:1.1	Mon Jul 28 18:22:47 2003
+++ Zope3/src/zope/configuration/tests/test_config.py	Tue Jul 29 15:56:45 2003
@@ -19,6 +19,7 @@
 import unittest
 from zope.testing.doctestunit import DocTestSuite
 from zope.configuration.config import metans, ConfigurationMachine
+from zope.configuration import config
 
 def test_config_extended_example():
     """Configuration machine
@@ -227,6 +228,22 @@
 
     >>> machine.actions
     [(('k', 'f'), f, ('f', 'c', 'x'), {}, (), 'yee ha')]
+    """
+
+def test_trailing_dot_in_resolve():
+    """Dotted names are no longer allowed to end in dots
+
+    >>> c = config.ConfigurationContext()
+
+    >>> c.resolve('zope.')
+    Traceback (most recent call last):
+    ...
+    ValueError: Trailing dots are no longer supported in dotted names
+
+    >>> c.resolve('  ')
+    Traceback (most recent call last):
+    ...
+    ValueError: The given name is blank
     """