[Subversion] / PEAK / src / peak / util / mockdb.py |
No default branch
Bookmark a link to HEAD:
(view)
(download)
(as text)
Added 'peak.core' as a minimal subset of 'peak.api'. 'peak.core' offers only "core" API packages and primitives, not the full set of available framework APIs. 'peak.api' will continue to expand as frameworks are added, but 'peak.core' will stay as small as practical. ('peak.exceptions' may in fact end up being removed from 'peak.core', or at least renamed.) Also, added 'peak.util.symbol' module, to contain 'NOT_GIVEN', 'NOT_FOUND', and the 'Symbol' class used to create them.
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.
cvs-admin@eby-sarna.com Powered by ViewCVS 1.0-dev |
ViewCVS and CVS Help |