SF.net SVN: fclient: [431] trunk/sandbox/fcp2/fcp_lib/pmstruct.py
Status: Pre-Alpha
Brought to you by:
jurner
|
From: <jU...@us...> - 2008-06-30 08:55:46
|
Revision: 431
http://fclient.svn.sourceforge.net/fclient/?rev=431&view=rev
Author: jUrner
Date: 2008-06-30 01:55:28 -0700 (Mon, 30 Jun 2008)
Log Message:
-----------
epydoc did not like whitespace in doctests
Modified Paths:
--------------
trunk/sandbox/fcp2/fcp_lib/pmstruct.py
Modified: trunk/sandbox/fcp2/fcp_lib/pmstruct.py
===================================================================
--- trunk/sandbox/fcp2/fcp_lib/pmstruct.py 2008-06-30 08:54:21 UTC (rev 430)
+++ trunk/sandbox/fcp2/fcp_lib/pmstruct.py 2008-06-30 08:55:28 UTC (rev 431)
@@ -50,41 +50,41 @@
Field names must corrospond to mapping names
>>> p = S.toString({'IAmInvalid': 123456, 'Bar': 'abcdefg'})
Traceback (most recent call last):
- ...
+ ...
KeyError: 'Foo'
All field names must be present in the mapping passed
>>> p = S.toString({'Bar': 'abcdefg'})
Traceback (most recent call last):
- ...
+ ...
KeyError: 'Foo'
types of the mapping have to corrospond to field types
>>> p = S.toString({'Foo': 'invalid-int', 'Bar': 'abcdefg'})
Traceback (most recent call last):
- ...
+ ...
ValueError: Invalid type for field "Foo, expected: <type 'int'>"
invalid field types are detected on converting the string back to a mapping
>>> p = 'invalid-int\\x01YWJjZGVmZw=='
>>> S.fromString(p)
Traceback (most recent call last):
- ...
+ ...
ValueError: Invalid field #0: (invalid literal for int() with base 10: 'invalid-int')
too few fields in the input strig will be recognized
>>> p = 'YWJjZGVmZw=='
>>> S.fromString(p)
Traceback (most recent call last):
- ...
+ ...
ValueError: Too few fields in input string
...aswell as too many
>>> p = '999\x01123456\x01YWJjZGVmZw=='
>>> S.fromString(p)
Traceback (most recent call last):
- ...
+ ...
ValueError: Too many fields in input string
"""
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|