Commit Graph

25 Commits

Author SHA1 Message Date
Daniele Varrazzo
b96dcef8a2 Fixed PG -> Py encodings mapping with non-alnum chars.
We mangle the encoding names a little bit before asking it to the
backend: be sure to be able to find the equivalent Python code back or
decoding (unicode cast or Py3) will barf.
2010-12-21 04:02:14 +00:00
Daniele Varrazzo
361786f4a8 More careful connections handling during tests. 2010-11-28 17:29:37 +00:00
Daniele Varrazzo
598b9424d2 Deal uniformly with test servers without pg_sleep. 2010-11-28 17:29:36 +00:00
Daniele Varrazzo
2b6d2017ed Added paranoia test to check we haven't broken gil release.
Got scared testing cancel with a signal as it doesn't work. But probably
signals are not deliveded to Python in the middle of an opcode.
2010-11-28 17:29:35 +00:00
Daniele Varrazzo
0c7b0a943b A prepared connection can't be canceled. 2010-11-28 12:15:26 +00:00
Daniele Varrazzo
19ead4a5cb Test cleanup.
Tests pass or fail gracefully on older PostgreSQL versions.

If unittest2 is available, skip tests instead of printing warnings.
2010-11-19 03:55:37 +00:00
Daniele Varrazzo
bcacdc8461 Added enum with possilbe isolation level states.
Also, general isolation levels cleanup and tests added.
2010-11-18 00:31:51 +00:00
Daniele Varrazzo
9849083628 Added tests to check the effective isolation level. 2010-11-17 01:04:34 +00:00
Daniele Varrazzo
cd19f9115d Fixed notices order (ticket #9). 2010-11-11 11:54:43 +00:00
Daniele Varrazzo
0d318179a9 Fixed test syntax for py 2.4. 2010-11-09 00:09:32 +00:00
Daniele Varrazzo
7276c4a6b1 Tests fail gracefully if tpc is supported but disabled by the server. 2010-11-08 01:28:00 +00:00
Daniele Varrazzo
3e658c33b5 Ensure unicode is accepted as type for transaction ids.
We don't do somersaults to ensure people can use snowmen as transaction
ids anyway: it would require passing the connection to xid_ensure and
down below to use the correct encoding.
2010-11-05 09:34:50 +00:00
Daniele Varrazzo
4f3976681a Added Xid.from_string() constructor.
It exposes the parsing rules used in restore.
2010-11-05 09:34:49 +00:00
Daniele Varrazzo
774be1d616 Dropped XID_UNPARSED: we use format_id = None for PG xact ids. 2010-11-05 09:34:49 +00:00
Daniele Varrazzo
978cac3a1b XA transaction ids can be decoded from PostgreSQL transaction ids. 2010-11-05 09:34:48 +00:00
Daniele Varrazzo
c0c116dcc4 Use pgjdbc algorithm to convert XA xids into strings. 2010-11-05 09:34:48 +00:00
Daniele Varrazzo
397eace051 Added tests for two-phase commit/rollback. 2010-11-05 09:34:48 +00:00
Daniele Varrazzo
56c02b0f94 Added tpc_recover method. 2010-11-05 09:34:48 +00:00
Daniele Varrazzo
df959c20be Making sync and async connection setup somewhat more consistent. 2010-04-23 13:24:35 +01:00
Daniele Varrazzo
d71520db9a Read the server version only after connection established. 2010-04-21 15:31:07 +01:00
Daniele Varrazzo
12ef826d50 Dropped redundant call to conn_notice_process().
If the connection is sync, notices will be processed by pq_fetch()
downstream.

If the connection is async, here we have only sent the query: no result
is ready yet, and neither notices have had a chance to arrive: they will
be retrieved later by pq_is_busy().

Added tests to check the above statement don't break.
2010-04-21 15:09:14 +01:00
Federico Di Gregorio
611606d532 Changes license to LGPL3 + OpenSSL exception on all source files 2010-02-12 23:34:53 +01:00
Federico Di Gregorio
36aff2f73d Implemented connection.reset() 2009-08-09 16:19:08 +02:00
James Henstridge
2f3f4c1258 2008-04-21 Jorgen Austvik <Jorgen.Austvik@sun.com>
* tests/*.py: use the DSN constructed in tests/__init__.py.

	* tests/__init__.py: allow setting the host, port and user for the
	DSN used by the tests through the environment.
2008-04-20 23:12:21 +00:00
James Henstridge
3265dd172d * tests/test_connection.py (ConnectionTests): add simple tests for
the Connection and Cursor "closed" attributes.

	* psycopg/cursor_type.c (psyco_curs_get_closed): add a "closed"
	attribute to cursors.  It will be True if either the cursor or its
	associated connection are closed.  This fixes bug #164.
2008-01-19 03:32:42 +00:00