File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import ConfigParser
22import StringIO
33
4+ from test_support import TestFailed
5+
6+
47def basic (src ):
58 print
69 print "Testing basic accessors..."
@@ -25,6 +28,27 @@ def basic(src):
2528 else :
2629 print '__name__ "option" properly hidden by the API.'
2730
31+ # Make sure the right things happen for remove_option();
32+ # added to include check for SourceForge bug #123324:
33+ if not cf .remove_option ('Foo Bar' , 'foo' ):
34+ raise TestFailed (
35+ "remove_option() failed to report existance of option" )
36+ if cf .has_option ('Foo Bar' , 'foo' ):
37+ raise TestFailed ("remove_option() failed to remove option" )
38+ if cf .remove_option ('Foo Bar' , 'foo' ):
39+ raise TestFailed (
40+ "remove_option() failed to report non-existance of option"
41+ " that was removed" )
42+ try :
43+ cf .remove_option ('No Such Section' , 'foo' )
44+ except ConfigParser .NoSectionError :
45+ pass
46+ else :
47+ raise TestFailed (
48+ "remove_option() failed to report non-existance of option"
49+ " that never existed" )
50+
51+
2852def interpolation (src ):
2953 print
3054 print "Testing value interpolation..."
You can’t perform that action at this time.
0 commit comments