Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
3d5f7e83
Commit
3d5f7e83
authored
Dec 04, 2000
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test cases for ConfigParser.remove_option() behavior. This includes
coverage to ensure bug #124324 does not re-surface.
parent
ff4a23bb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
Lib/test/test_cfgparser.py
Lib/test/test_cfgparser.py
+24
-0
No files found.
Lib/test/test_cfgparser.py
View file @
3d5f7e83
import
ConfigParser
import
StringIO
from
test_support
import
TestFailed
def
basic
(
src
):
print
print
"Testing basic accessors..."
...
...
@@ -25,6 +28,27 @@ def basic(src):
else
:
print
'__name__ "option" properly hidden by the API.'
# Make sure the right things happen for remove_option();
# added to include check for SourceForge bug #123324:
if
not
cf
.
remove_option
(
'Foo Bar'
,
'foo'
):
raise
TestFailed
(
"remove_option() failed to report existance of option"
)
if
cf
.
has_option
(
'Foo Bar'
,
'foo'
):
raise
TestFailed
(
"remove_option() failed to remove option"
)
if
cf
.
remove_option
(
'Foo Bar'
,
'foo'
):
raise
TestFailed
(
"remove_option() failed to report non-existance of option"
" that was removed"
)
try
:
cf
.
remove_option
(
'No Such Section'
,
'foo'
)
except
ConfigParser
.
NoSectionError
:
pass
else
:
raise
TestFailed
(
"remove_option() failed to report non-existance of option"
" that never existed"
)
def
interpolation
(
src
):
print
print
"Testing value interpolation..."
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment