summaryrefslogtreecommitdiff
path: root/test_configobj.py
diff options
context:
space:
mode:
authorfuzzyman <devnull@localhost>2009-10-25 17:52:41 +0000
committerfuzzyman <devnull@localhost>2009-10-25 17:52:41 +0000
commitcead96333b2a8420906fc832be1f9805770e6c14 (patch)
treefa3bc62ed8e96528a34577a3cf2bb03f1c4d8f57 /test_configobj.py
parent05c1e062a9e71fe63c7fed3709dfc22699d47f22 (diff)
downloadconfigobj-cead96333b2a8420906fc832be1f9805770e6c14.tar.gz
Fixing bugs.
Diffstat (limited to 'test_configobj.py')
-rw-r--r--test_configobj.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/test_configobj.py b/test_configobj.py
index 2d105a0..f73517a 100644
--- a/test_configobj.py
+++ b/test_configobj.py
@@ -1197,7 +1197,20 @@ def _test_validate():
... 'test4': 6.0
... }}}
1
-
+ >>> a = ['foo = fish']
+ >>> b = ['foo = integer(default=3)']
+ >>> c = ConfigObj(a, configspec=b)
+ >>> c
+ ConfigObj({'foo': 'fish'})
+ >>> from validate import Validator
+ >>> v = Validator()
+ >>> c.validate(v)
+ 0
+ >>> c.default_values
+ {'foo': 3}
+ >>> c.restore_default('foo')
+ 3
+
Now testing with repeated sections : BIG TEST
>>> repeated_1 = '''