summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
| * test_async made properly executable.Daniele Varrazzo2010-04-111-0/+4
| |
| * Added test to check that connections subclasses can be asynchronous.Daniele Varrazzo2010-04-081-0/+11
| |
* | Added test for refcounting/gc bug reported by Michael TharpFederico Di Gregorio2010-04-081-0/+31
|/
* Added some COPY tests.Daniele Varrazzo2010-04-072-0/+106
|
* Adapt the tests to recent changesJan Urbański2010-04-051-54/+80
| | | | | | Some methods were forbidden in asynchronous mode, the isolation level of an asynchronous connection is not always 0 and these changes influenced expected test results.
* Add tests for the asynchronous APIJan Urbański2010-04-052-0/+254
|
* Support large objects truncating.Jan Urbański2010-03-291-1/+65
| | | | | | The lobject.truncate(len=0) method will be available if psycopg2 has been built against libpq from 8.3 or later (which is when the lobject truncating support has been introduced).
* Fixed problem with decimal.Decimal conversionsFederico Di Gregorio2010-02-211-5/+15
|
* Changes license to LGPL3 + OpenSSL exception on all source filesFederico Di Gregorio2010-02-129-34/+53
|
* Now adapt() errors include the type nameFederico Di Gregorio2009-11-251-0/+9
|
* Fixed test broken by float precision fixFederico Di Gregorio2009-11-251-2/+2
|
* Added support for UUID arraysFederico Di Gregorio2009-10-041-1/+21
|
* Fixed problem with large writes in large objects codeFederico Di Gregorio2009-08-091-0/+15
|
* Implemented connection.reset()Federico Di Gregorio2009-08-091-0/+12
|
* Fixed bug in RealDictCursor when prefetchingFederico Di Gregorio2009-05-091-1/+28
|
* Removed unecessary importFederico Di Gregorio2009-04-041-1/+0
|
* Fixed test_dates failures in older version of PythonFederico Di Gregorio2009-04-011-4/+4
|
* Fixed lobject test failuresFederico Di Gregorio2009-04-011-0/+1
|
* Fixed error in register_type()Federico Di Gregorio2009-03-023-4/+43
|
* * tests/test_dates.py (DatetimeTests, mxDateTimeTests): full testJames Henstridge2009-02-171-59/+145
| | | | | | | | | | | | | | | | | | coverage for datetime and time strings with and without time zone information. * psycopg/typecast_datetime.c (typecast_PYDATETIME_cast): adjust to handle the changes in typecast_parse_time. (typecast_PYTIME_cast): add support for time zone aware time values. * psycopg/typecast_mxdatetime.c (typecast_MXDATE_cast): make sure that values with time zones are correctly processed (even though that means ignoring the time zone value). (typecast_MXTIME_cast): same here. * psycopg/typecast.c (typecast_parse_time): Update method to parse second resolution timezone offsets.
* * psycopg/typecast.c (typecast_parse_time): Fix up handling ofJames Henstridge2009-02-171-1/+4
| | | | | | | | negative timezone offsets with a non-zero minutes field. * tests/test_dates.py (DatetimeTests): Add tests for time zone parsing. The test for HH:MM:SS time zones is disabled because we don't currently support it.
* Add tests for time zone parsing, for "HH", "HH:MM" and "HH:MM:SS" forms. James Henstridge2009-02-171-0/+39
| | | | | | Currently the second fails for negative offsets due to bugs in the parser, and the third fails because it doesn't even try to parse second offset values (as Python doesn't either).
* Added adapter to handle float('inf') and float('nan')Federico Di Gregorio2009-01-231-0/+8
|
* Added inet supportFederico Di Gregorio2008-09-241-0/+9
|
* Support for NULLs in UUIDFederico Di Gregorio2008-09-231-0/+3
|
* Added suppport for UUID and related test.Federico Di Gregorio2008-09-192-1/+55
|
* * tests/test_lobject.py (LargeObjectTests): add more tests,James Henstridge2008-05-061-11/+179
| | | | | | | | | | | | | | | | including behaviour on closed lobjects and stale lobjects. * psycopg/lobject_type.c (psyco_lobj_close): don't mark the connection closed here because it is done by lobject_close_locked(). * psycopg/lobject_int.c (lobject_open): mark objects as not closed if we successfully open them. (lobject_close_locked): mark the lobject closed here. (lobject_export): ensure we are in a transaction, since lo_export() issues multiple queries. * psycopg/lobject_type.c (lobject_setup): make lobjects start closed.
* Add basic tests for large object code. Fix lobject.seek() to actually James Henstridge2008-05-052-0/+82
| | | | work.
* 2008-04-21 James Henstridge <james@jamesh.id.au>James Henstridge2008-04-201-2/+11
| | | | | | * tests/test_quote.py (QuotingTestCase.test_unicode): If the server encoding is not UTF8, skip the unicode test and emit a warning.
* 2008-04-21 Jorgen Austvik <Jorgen.Austvik@sun.com>James Henstridge2008-04-208-9/+21
| | | | | | | * 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.
* * psycopg/typecast.c (typecast_parse_time): give the correctJames Henstridge2008-03-171-233/+19
| | | | | | | | | | | | | | | | | | | | | | return value for partially parsed time values. * psycopg/typecast_mxdatetime.c (typecast_MXDATE_cast): return NULL after setting DataError. Also, don't treat it as an error if typecast_parse_time() returns 0 (as might happen if the remainder of the string is " BC"). * psycopg/typecast_datetime.c (typecast_PYDATE_cast): return NULL after setting DataError. (typecast_PYDATETIME_cast): same here. (typecast_PYTIME_cast): same here. * tests/test_dates.py (CommonDatetimeTestsMixin.test_parse_incomplete_date): test that parsing incomplete date values results in DataError. (CommonDatetimeTestsMixin.test_parse_incomplete_time): same for times. (CommonDatetimeTestsMixin.test_parse_incomplete_time): same for datetimes.
* * tests/test_connection.py (ConnectionTests): add simple tests forJames Henstridge2008-01-193-8/+40
| | | | | | | | 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.
* Split the binary tests out a bit.James Henstridge2008-01-161-2/+8
|
* * tests/test_transaction.py (DeadlockSerializationTestCase): portJames Henstridge2008-01-161-1/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | over some tests for serialisation and deadlock errors, demonstrating that TransactionRollbackError is generated. (QueryCancelationTests): add a test to show that QueryCanceledError is raised on statement timeouts. * psycopg2da/adapter.py (_handle_psycopg_exception): rather than checking exception messages, check for TransactionRollbackError. * psycopg/pqpath.c (exception_from_sqlstate): return TransactionRollbackError for 40xxx errors, and QueryCanceledError for 57014 errors. (pq_raise): If we are using an old server, use TransactionRollbackError if the error message contains "could not serialize" or "deadlock detected". * psycopg/psycopgmodule.c (_psyco_connect_fill_exc): remove function, since we no longer need to store pointers to the exceptions in the connection. This also fixes a reference leak. (psyco_connect): remove _psyco_connect_fill_exc() function call. * psycopg/connection.h (connectionObject): remove exception members from struct. * psycopg/connection_type.c (connectionObject_getsets): modify the exception attributes on the connection object from members to getsets. This reduces the size of the struct. * lib/extensions.py: import the two new extensions. * psycopg/psycopgmodule.c (exctable): add new QueryCanceledError and TransactionRollbackError exceptions.
* * tests/__init__.py (test_suite): add date tests to test suite.James Henstridge2008-01-162-0/+470
| | | | | | | | | | | | | | | * tests/test_dates.py: add tests for date/time typecasting and adaption. * psycopg/adapter_mxdatetime.c (mxdatetime_str): add support for outputting BC dates (which involves switching them to one-based dates). Also remove broken handling of microseconds. * psycopg/typecast.c (typecast_parse_date): if the string ends with "BC" adjust the year value to be a zero-based BC value as used by mx.DateTime (datetime doesn't support BC dates). (typecast_parse_time): ignore ' ', 'B' and 'C' in time strings rather than treating them as part of the seconds part of the time.
* * tests/test_transaction.pyJames Henstridge2008-01-111-1/+1
| | | | | | | | | | | | | (TransactionTestCase.test_failed_commit): Expect IntegrityError instead of OperationalError. * psycopg/pqpath.c (exception_from_sqlstate): new function that converts an SQLSTATE error code to the corresponding exception class. (pq_raise): use exception_from_sqlstate() to pick which exception to use when working with protocol version 3. (pq_complete_error): Let pq_raise() pick an appropriate exception rather than forcing OperationalError.
* * psycopg/adapter_binary.c (binary_quote): apply Brandon Rhodes'James Henstridge2008-01-101-2/+6
| | | | | | | | | | | 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.
* Added 'make check' target, running all the available tests.Daniele Varrazzo2007-11-117-68/+77
| | | | | | Most of the updates have been provided by James Henstridge. Closes ticket #195.
* Use escape string syntax for string escape if connected to a server Daniele Varrazzo2007-11-111-0/+77
| | | | | | | | | | | requiring it. Added a connection flag to store whether E''-style quoting is required: this avoids repeated PQparameterStatus() calls. Added a test case to verify correct behavior on strings, unicode and binary data. Tested with PG versions from 7.4 to 8.3b2, with any server 'standard_conforming_strings' setting and with 'PSYCOPG_OWN_QUOTING' too.
* - Tabs fixed.Daniele Varrazzo2007-11-111-9/+9
|
* Added test for DateTime object allocation bug.Federico Di Gregorio2007-09-191-0/+10
|
* Fixed bug #194 (and added nice MD project not that C/C++ is supported.)Federico Di Gregorio2007-09-082-0/+97
|
* Fixed patch from #119.Federico Di Gregorio2006-09-011-2/+2
|
* Empty binary buffer segfault fix (closes: #119).Federico Di Gregorio2006-09-011-0/+3
|
* Added DBAPI 2.0 conformance tests in tests/.Federico Di Gregorio2006-02-112-0/+885
|
* Releasing 2.0b4.Federico Di Gregorio2005-07-172-10/+21
|
* Fixed .execute() segfault.Federico Di Gregorio2005-06-021-0/+8
|
* Regression tests fixes.Federico Di Gregorio2005-05-271-3/+4
|
* Optimizations to type casting (in preparation to array support.)Federico Di Gregorio2005-03-121-0/+2
|
* Preparing 1.99.12.1_99_12Federico Di Gregorio2005-03-031-4/+4
|