[Zope3-checkins] CVS: Zope3/src/zope/app/dublincore/tests - test_dcsv.py:1.2

Fred L. Drake, Jr. fred at zope.com
Tue Aug 26 11:45:02 EDT 2003


Update of /cvs-repository/Zope3/src/zope/app/dublincore/tests
In directory cvs.zope.org:/tmp/cvs-serv16891

Modified Files:
	test_dcsv.py 
Log Message:
adding some tests I wrote last week that didn't get committed, mostly
because I got busy with other things


=== Zope3/src/zope/app/dublincore/tests/test_dcsv.py 1.1 => 1.2 ===
--- Zope3/src/zope/app/dublincore/tests/test_dcsv.py:1.1	Fri Aug 22 09:11:03 2003
+++ Zope3/src/zope/app/dublincore/tests/test_dcsv.py	Tue Aug 26 10:45:01 2003
@@ -284,6 +284,42 @@
     'b=c; a;'
     """
 
+def test_encode_error_non_strings():
+    """
+    >>> encode([(42, '')])
+    Traceback (most recent call last):
+    ...
+    TypeError: labels must be strings; found 42
+    >>> encode([('', 42)])
+    Traceback (most recent call last):
+    ...
+    TypeError: values must be strings; found 42
+    >>> encode([('label', 42)])
+    Traceback (most recent call last):
+    ...
+    TypeError: values must be strings; found 42
+    """
+
+def test_encode_error_outer_whitespace():
+    """
+    >>> encode([' a'])
+    Traceback (most recent call last):
+    ...
+    ValueError: values may not include leading or trailing spaces: ' a'
+    >>> encode(['a '])
+    Traceback (most recent call last):
+    ...
+    ValueError: values may not include leading or trailing spaces: 'a '
+    >>> encode([('', 'a ')])
+    Traceback (most recent call last):
+    ...
+    ValueError: values may not include leading or trailing spaces: 'a '
+    >>> encode([('label', 'a ')])
+    Traceback (most recent call last):
+    ...
+    ValueError: values may not include leading or trailing spaces: 'a '
+    """
+
 
 def test_suite():
     return DocTestSuite()




More information about the Zope3-Checkins mailing list