Contact: fumanchu@aminus.org

Log in as guest/dejavu to create tickets

I think I've seen this ORM somewhere before...

root/trunk/test/test_storepypgsql.py

Revision 367 (checked in by fumanchu, 6 years ago)

Added a "managers" registry to dejavu.storage. This allows short names to be used in config instead of full class names.

  • Property svn:eol-style set to native
Line 
1
2 try:
3     from pyPgSQL import libpq
4 except ImportError:
5     def run():
6         import warnings
7         warnings.warn("The pyPgSQL.libpq module could not be imported. "
8                       "The pyPgSQL test will not be run.")
9 else:
10     user = "postgres"
11     passwd = ""
12    
13     if passwd == "":
14         passwd = raw_input("Enter the password for the PostgreSQL '%s' user:" % user)
15    
16     opts = {u'Connect': ("host=localhost dbname=dejavu_test "
17                          "user=%s password=%s" % (user, passwd)),
18             }
19     SM_class = "postgres"
20    
21     del user, passwd
22    
23     def run():
24         # Isolate schema changes from one test to the next.
25         import zoo_fixture
26        
27         print "Testing PostgreSQL with 'SQL_ASCII' encoding..."
28         opts['encoding'] = "SQL_ASCII"
29         reload(zoo_fixture)
30         zoo_fixture.init()
31         zoo_fixture.run(SM_class, opts)
32        
33         print
34         print "Testing PostgreSQL with 'UNICODE' encoding..."
35         opts['encoding'] = "UNICODE"
36         reload(zoo_fixture)
37         zoo_fixture.init()
38         zoo_fixture.run(SM_class, opts)
39
40 if __name__ == "__main__":
41     run()
Note: See TracBrowser for help on using the browser.