~pythonregexp2.7/python/issue2636-09-01+10

« back to all changes in this revision

Viewing changes to Lib/bsddb/test/test_recno.py

  • Committer: Jeffrey C. "The TimeHorse" Jacobs
  • Date: 2008-09-22 21:39:45 UTC
  • mfrom: (39055.1.33 Regexp-2.7)
  • Revision ID: darklord@timehorse.com-20080922213945-23717m5eiqpamcyn
Merged in changes from the Single-Loop Engine branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
from pprint import pprint
7
7
import unittest
8
8
 
9
 
from test_all import verbose, get_new_environment_path, get_new_database_path
10
 
 
11
 
try:
12
 
    # For Pythons w/distutils pybsddb
13
 
    from bsddb3 import db
14
 
except ImportError:
15
 
    # For Python 2.3
16
 
    from bsddb import db
17
 
 
18
 
try:
19
 
    from bsddb3 import test_support
20
 
except ImportError:
21
 
    from test import test_support
 
9
from test_all import db, test_support, verbose, get_new_environment_path, get_new_database_path
22
10
 
23
11
letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
24
12
 
72
60
        try:
73
61
            data = d[0]  # This should raise a KeyError!?!?!
74
62
        except db.DBInvalidArgError, val:
75
 
            self.assertEqual(val[0], db.EINVAL)
 
63
            import sys
 
64
            if sys.version_info[0] < 3 :
 
65
                self.assertEqual(val[0], db.EINVAL)
 
66
            else :
 
67
                self.assertEqual(val.args[0], db.EINVAL)
76
68
            if verbose: print val
77
69
        else:
78
70
            self.fail("expected exception")
277
269
        try:                    # this one will fail
278
270
            d.append('bad' * 20)
279
271
        except db.DBInvalidArgError, val:
280
 
            self.assertEqual(val[0], db.EINVAL)
 
272
            import sys
 
273
            if sys.version_info[0] < 3 :
 
274
                self.assertEqual(val[0], db.EINVAL)
 
275
            else :
 
276
                self.assertEqual(val.args[0], db.EINVAL)
281
277
            if verbose: print val
282
278
        else:
283
279
            self.fail("expected exception")