-
Notifications
You must be signed in to change notification settings - Fork 4
/
test_psycopg_dbapi20.py
38 lines (29 loc) · 1018 Bytes
/
test_psycopg_dbapi20.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python
# Test suite driver for psycopg2. This is not official - more an example.
import dbapi20
import unittest
import psycopg2 # Bug #877952
import subprocess
class test_Psycopg(dbapi20.DatabaseAPI20Test):
driver = psycopg2
connect_args = ()
connect_kw_args = {'dsn': 'dbname=dbapi20_test'}
lower_func = 'lower' # For stored procedure test
def setUp(self):
# Call superclass setUp In case this does something in the
# future
dbapi20.DatabaseAPI20Test.setUp(self)
try:
con = self._connect()
con.close()
except:
cmd = [ "psql", "-c", "create database dbapi20_test" ]
if subprocess.call(cmd):
self.fail("Failed to create databse.")
def tearDown(self):
dbapi20.DatabaseAPI20Test.tearDown(self)
def test_non_idempotent_close(self): pass
def test_nextset(self): pass
def test_setoutputsize(self): pass
if __name__ == '__main__':
unittest.main()