Sha256: 85d5877777803b34edeca7e1e7cbbee2fdaf0d7372e0b45360a6c858787f5019

Contents?: true

Size: 851 Bytes

Versions: 30

Compression:

Stored size: 851 Bytes

Contents

#! /usr/bin/env python
"""Test script for the gdbm module
   Roger E. Masse
"""

import gdbm
from gdbm import error
from test_support import verbose, verify, TestFailed

filename= '/tmp/delete_me'

g = gdbm.open(filename, 'c')
verify(g.keys() == [])
g['a'] = 'b'
g['12345678910'] = '019237410982340912840198242'
a = g.keys()
if verbose:
    print 'Test gdbm file keys: ', a

g.has_key('a')
g.close()
try:
    g['a']
except error:
    pass
else:
    raise TestFailed, "expected gdbm.error accessing closed database"
g = gdbm.open(filename, 'r')
g.close()
g = gdbm.open(filename, 'w')
g.close()
g = gdbm.open(filename, 'n')
g.close()
try:
    g = gdbm.open(filename, 'rx')
    g.close()
except error:
    pass
else:
    raise TestFailed, "expected gdbm.error when passing invalid open flags"

try:
    import os
    os.unlink(filename)
except:
    pass

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
rubyfox-server-2.12.1.0 lib/rubyfox/server/data/lib/Lib/test/test_gdbm.py
rubyfox-server-2.11.1.0 lib/rubyfox/server/data/lib/Lib/test/test_gdbm.py
rubyfox-server-2.9.2.0 lib/rubyfox/server/data/lib/Lib/test/test_gdbm.py
rubyfox-server-2.9.1.0 lib/rubyfox/server/data/lib/Lib/test/test_gdbm.py
rubyfox-server-2.9.0.0 lib/rubyfox/server/data/lib/Lib/test/test_gdbm.py
rubyfox-server-2.8.4.0 lib/rubyfox/server/data/lib/Lib/test/test_gdbm.py
rubyfox-server-2.8.0.1 lib/rubyfox/server/data/lib/Lib/test/test_gdbm.py
rubyfox-server-2.8.0.0 lib/rubyfox/server/data/lib/Lib/test/test_gdbm.py
rubyfox-server-2.3.0.0 lib/rubyfox/server/data/lib/Lib/test/test_gdbm.py
rubyfox-server-2.3.0.pre2 lib/rubyfox/server/data/lib/Lib/test/test_gdbm.py