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.19.2.0 lib/rubyfox/server/data/lib/Lib/test/test_gdbm.py
rubyfox-server-2.17.3.2 lib/rubyfox/server/data/lib/Lib/test/test_gdbm.py
rubyfox-server-2.17.3.1 lib/rubyfox/server/data/lib/Lib/test/test_gdbm.py
rubyfox-server-2.17.3.0 lib/rubyfox/server/data/lib/Lib/test/test_gdbm.py
rubyfox-server-2.16.3.2 lib/rubyfox/server/data/lib/Lib/test/test_gdbm.py
rubyfox-server-2.16.3.1 lib/rubyfox/server/data/lib/Lib/test/test_gdbm.py
rubyfox-server-2.16.0.4 lib/rubyfox/server/data/lib/Lib/test/test_gdbm.py
rubyfox-server-2.16.0.3 lib/rubyfox/server/data/lib/Lib/test/test_gdbm.py
rubyfox-server-2.16.0.2 lib/rubyfox/server/data/lib/Lib/test/test_gdbm.py
rubyfox-server-2.16.0.1 lib/rubyfox/server/data/lib/Lib/test/test_gdbm.py
rubyfox-server-2.16.0.0 lib/rubyfox/server/data/lib/Lib/test/test_gdbm.py
rubyfox-server-2.13.7.3 lib/rubyfox/server/data/lib/Lib/test/test_gdbm.py
rubyfox-server-2.13.6.2 lib/rubyfox/server/data/lib/Lib/test/test_gdbm.py
rubyfox-server-2.13.6.1 lib/rubyfox/server/data/lib/Lib/test/test_gdbm.py
rubyfox-server-2.13.5.1 lib/rubyfox/server/data/lib/Lib/test/test_gdbm.py
rubyfox-server-2.13.4.1 lib/rubyfox/server/data/lib/Lib/test/test_gdbm.py
rubyfox-server-2.13.3.1 lib/rubyfox/server/data/lib/Lib/test/test_gdbm.py
rubyfox-server-2.12.5.1 lib/rubyfox/server/data/lib/Lib/test/test_gdbm.py
rubyfox-server-2.12.5.0 lib/rubyfox/server/data/lib/Lib/test/test_gdbm.py
rubyfox-server-2.12.4.0 lib/rubyfox/server/data/lib/Lib/test/test_gdbm.py