Oleg Broytmann wrote:
>    Can you also add some tests? For example, add a duplicate record (key),
> catch an exception and test that the exception is really... what should it
> be? IntegrityError? ProgrammingError?
>   
A duplicate entry record will be signaled in both MySQL and SQLite 
modules as an
IntegrityError exception (as defined in PEP249), and it will be an 
IntegrityError in
SQLObject too. As I said, these backends follow a one to one mapping 
with the
exceptions inheritance layout described in PEP249:

        StandardError
        |__Warning
        |__Error
             |__InterfaceError
             |__DatabaseError
                  |__DataError
                  |__OperationalError
                  |__IntegrityError
                  |__InternalError
                  |__ProgrammingError
                  |__NotSupportedError

However, I found it useful to mark such an event in SQLObject with a 
specific exception,
dberrors.DuplicateEntryError, which is subclassed from 
dberrors.IntegrityError, and thus
can be catched as a generic dberrors.IntegrityError.
>    SQLObject's tests (based on py.test framework) allow one to limit
> platforms the tests are running on, so you can limit your tests to SQLite
> and MySQL.
>
> Oleg.
Could you please briefly explain what needs to be done in order to add a 
test in SQLObjects' test
suite?

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to