E&S CVS Commit: PEAK - Added 'peak.util.mockdb', a "mock object" implementation of a DBAPI 2.0

pje at eby-sarna.com pje at eby-sarna.com
Fri Nov 14 17:55:01 EST 2003

Module Name:	PEAK
Committed By:	pje
Date:		Fri Nov 14 22:54:16 UTC 2003

Modified Files:
	PEAK/src/peak: peak.ini
	PEAK/src/peak/storage: SQL.py
	PEAK/src/peak/util/tests: __init__.py
Added Files:
	PEAK/src/peak/util: mockdb.py
	PEAK/src/peak/util/tests: test_mockdb.py

Log Message:
Added 'peak.util.mockdb', a "mock object" implementation of a DBAPI 2.0
driver module.  'mockdb' connections can be told to 'expect()' queries
and 'provide()' data to their callers, and will raise AssertionErrors when
they are used in a way that doesn't conform to your supplied expectations.
This is intended to be used for unit testing components that depend on
a database connection: you can verify that they send the right SQL, and
you can provide them with dummy data to use.  There is also a 'mockdb:' URL
and peak.storage driver, so you can easily use a mock DB connection in
place of a real one within a PEAK application, for testing purposes.  Note,
however, that 'peak.util.mockdb' is a DBAPI 2.0 driver in itself, and thus
can also be used to test DBAPI usage outside of PEAK.

To view diffs of this commit, you can use the following URL(s):

To generate a diff of this commit:
cvs rdiff -r1.91 -r1.92 PEAK/CHANGES.txt
cvs rdiff -r1.83 -r1.84 PEAK/src/peak/peak.ini
cvs rdiff -r1.61 -r1.62 PEAK/src/peak/storage/SQL.py
cvs rdiff -r0 -r1.1 PEAK/src/peak/util/mockdb.py
cvs rdiff -r1.10 -r1.11 PEAK/src/peak/util/tests/__init__.py
cvs rdiff -r0 -r1.1 PEAK/src/peak/util/tests/test_mockdb.py

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

More information about the source-changes mailing list