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
2f1064c7
Commit
2f1064c7
authored
Jan 18, 2001
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A dumb test for the dumdbm module.
parent
890f2096
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
0 deletions
+40
-0
Lib/test/output/test_dumbdbm
Lib/test/output/test_dumbdbm
+1
-0
Lib/test/test_dumbdbm.py
Lib/test/test_dumbdbm.py
+39
-0
No files found.
Lib/test/output/test_dumbdbm
0 → 100644
View file @
2f1064c7
test_dumbdbm
Lib/test/test_dumbdbm.py
0 → 100644
View file @
2f1064c7
#! /usr/bin/env python
"""Test script for the dumbdbm module
Original by Roger E. Masse
"""
# XXX This test is a disgrace. It doesn't test that it works.
import
dumbdbm
as
dbm
from
dumbdbm
import
error
from
test_support
import
verbose
filename
=
'/tmp/delete_me'
d
=
dbm
.
open
(
filename
,
'c'
)
d
[
'a'
]
=
'b'
d
[
'12345678910'
]
=
'019237410982340912840198242'
d
.
keys
()
if
d
.
has_key
(
'a'
):
if
verbose
:
print
'Test dbm keys: '
,
d
.
keys
()
d
.
close
()
d
=
dbm
.
open
(
filename
,
'r'
)
d
.
close
()
d
=
dbm
.
open
(
filename
,
'w'
)
d
.
close
()
d
=
dbm
.
open
(
filename
,
'n'
)
d
.
close
()
import
os
def
rm
(
fn
):
try
:
os
.
unlink
(
fn
)
except
os
.
error
:
pass
rm
(
filename
+
'.dir'
)
rm
(
filename
+
'.dat'
)
rm
(
filename
+
'.bak'
)
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