Contact: fumanchu@aminus.org

Log in as guest/geniusql to create tickets

root/trunk/geniusql/test/test_psycopg.py

Revision 322 (checked in by lakin, 2 months ago)

fixing the PgPickle? class which was not correctly undoing some of its own changes. Now the psycopg tests mostly pass.

  • Property svn:eol-style set to native
Line 
1
2 try:
3     try:
4         # If possible, you should copy the _psycopg.pyd file into a top level
5         # so the SM can avoid importing the entire package.
6         import _psycopg
7     except ImportError:
8         from psycopg2 import _psycopg
9 except ImportError:
10     def run():
11         import warnings
12         warnings.warn("The psycopg2._psycopg module could not be imported. "
13                       "The psycopg test will not be run.")
14 else:
15     user = "geniusql_test"
16     passwd = "geniusql_test"
17
18     opts = {'connections.Connect':
19                 ("host=localhost dbname=geniusql_test user=%s password=%s"
20                  % (user, passwd)),
21             'name': 'geniusql_test',
22             'encoding': 'UTF8',
23             }
24     DB_class = "psycopg"
25
26
27     from geniusql.test import zoo_fixture, test
28
29     db = test.DBConfig(DB_class, opts)
30     setUp = db.setUp
31     tearDown = db.tearDown
32
33     #---------------------------------------------------------------------------
34     class Phase1_ZooTests(zoo_fixture.Phase1_ZooTests):
35         pass
36     db.register_db_test_class(Phase1_ZooTests)
37
38     #---------------------------------------------------------------------------
39     class Phase2_ConcurrencyTests(zoo_fixture.Phase2_ConcurrencyTests):
40         pass
41     db.register_db_test_class(Phase2_ConcurrencyTests)
42
43     #---------------------------------------------------------------------------
44     class Phase2_IsolationTests(zoo_fixture.Phase2_IsolationTests):
45         pass
46     db.register_db_test_class(Phase2_IsolationTests)
47
48     #---------------------------------------------------------------------------
49     class Phase2_TransactionTests(zoo_fixture.Phase2_TransactionTests):
50         pass
51     db.register_db_test_class(Phase2_TransactionTests)
52
53     #---------------------------------------------------------------------------
54     # TODO: this isn't ported yet.
55     #class Phase2_NumericTests(zoo_fixture.Phase2_NumericTests):
56             #pass
57     #db.register_db_test_class(Phase2_NumericTests)
58
59     #---------------------------------------------------------------------------
60     class Phase2_ConnectionTests(zoo_fixture.Phase2_ConnectionTests):
61         pass
62     db.register_db_test_class(Phase2_ConnectionTests)
63
64     #---------------------------------------------------------------------------
65     class Phase2_SQLInjectionTests(zoo_fixture.Phase2_SQLInjectionTests):
66         pass
67     db.register_db_test_class(Phase2_SQLInjectionTests)
68
Note: See TracBrowser for help on using the browser.