Commit Graph

30 Commits

Author SHA1 Message Date
Daniele Varrazzo
b78ff4a273 Several tests ported to Python 3. 2010-12-31 03:18:27 +01:00
Daniele Varrazzo
60841c6567 Added regression test on bool adaptation. 2010-12-31 03:18:27 +01:00
Daniele Varrazzo
beba064983 Test on basic adapters pass on Python 3. 2010-12-31 03:18:26 +01:00
Daniele Varrazzo
89e4d4c7bb Empty lists correctly roundtrip. 2010-12-31 03:18:26 +01:00
Daniele Varrazzo
ade1b2cc7b Test suite converted into a proper package.
Dropped cyclic import from modules to tests: they were only working
because a second copy of the package was found in the project dir.
Use relative import so that 2to3 can do a good conversion.
2010-12-21 05:02:19 +00:00
Daniele Varrazzo
361786f4a8 More careful connections handling during tests. 2010-11-28 17:29:37 +00:00
Daniele Varrazzo
bb44bcd5b5 Skipped inf test on the platform not supporting it (win32). 2010-11-24 10:50:28 +00:00
Daniele Varrazzo
21dfc2c592 Float test skipped where the server doesn't support inf. 2010-11-19 10:44:39 +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
11c021cb21 Fixed tests to run on Windows. 2010-11-11 10:39:35 +00:00
Daniele Varrazzo
62d3a1533b Use the adapter of an object superclass if available. 2010-11-08 01:35:06 +00:00
Daniele Varrazzo
c8aef26e15 Adapt buffer objects using an explicit cast on the string literal.
Don't rely on Postgres casting the literal according to the context:
this doesn't work e.g. passing the object as function argument where a
function with the same name but taking a text exists. It doesn't work
either when the object is in an ARRAY construct.

Added test to check the type is respected in a complete Py -> PG -> Py
roundtrip without context.

Bug and solution reported by Peter Eisentraut.
2010-05-15 14:27:23 +01:00
Federico Di Gregorio
192034dc38 Fixed problem with decimal.Decimal conversions 2010-02-21 01:04:00 +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
d40a5321f2 Fixed test broken by float precision fix 2009-11-25 10:38:31 +01:00
Federico Di Gregorio
eb25f9f154 Added adapter to handle float('inf') and float('nan') 2009-01-23 00:09:20 +01:00
Federico Di Gregorio
b92601306e Added suppport for UUID and related test. 2008-09-19 21:25:16 +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
bc663111b6 Split the binary tests out a bit. 2008-01-16 18:08:12 +00:00
James Henstridge
86597f6939 * psycopg/adapter_binary.c (binary_quote): apply Brandon Rhodes'
patch from ticket #209 to check return value from
	PyObject_AsCharBuffer().  This fixes the segfault.
	(binary_quote): switch from PyObject_AsCharBuffer() to
	PyObject_AsReadBuffer() to support buffer objects that don't
	implement the bf_getcharbuf protocol.

	* tests/types_basic.py (TypesBasicTests.testBinary): Test round
	tripping of bytea buffers.  Currently segfaults.
2008-01-10 22:19:23 +00:00
Daniele Varrazzo
67afd678b0 Added 'make check' target, running all the available tests.
Most of the updates have been provided by James Henstridge.

Closes ticket #195.
2007-11-11 10:40:12 +00:00
Daniele Varrazzo
a6ea092acc - Tabs fixed. 2007-11-11 03:58:45 +00:00
Federico Di Gregorio
9f9af5f907 Fixed patch from #119. 2006-09-01 12:36:38 +00:00
Federico Di Gregorio
f88b973bd1 Empty binary buffer segfault fix (closes: #119). 2006-09-01 08:23:51 +00:00
Federico Di Gregorio
c281a38236 Releasing 2.0b4. 2005-07-17 04:26:27 +00:00
Federico Di Gregorio
b300cd2550 Fixed .execute() segfault. 2005-06-02 04:30:31 +00:00
Federico Di Gregorio
2804f9a6a9 Regression tests fixes. 2005-05-27 08:43:33 +00:00
Federico Di Gregorio
9316c6af53 Optimizations to type casting (in preparation to array support.) 2005-03-12 06:39:47 +00:00
Federico Di Gregorio
131b8ac1c5 Preparing 1.99.12. 2005-03-03 06:52:28 +00:00
Federico Di Gregorio
6ad60725be Writing tests... 2004-12-20 02:33:12 +00:00