tests.yawning_titan_db_patch#

Provides a patch to the YawningTitanDB.

Functions

yawning_titan_db_init_patch

Patch the yawning_titan.db.yawning_titan_db.YawningTitanDB.__init__().

yawning_titan_db_test_defaults_patch

Patch the YawningTitanDB so point to the tests/_package_data directory.

tests.yawning_titan_db_patch.yawning_titan_db_init_patch(self, name)[source]#

Patch the yawning_titan.db.yawning_titan_db.YawningTitanDB.__init__().

So that TinyDB testing can be done in isolation, the main init method is patched so that a temporary .json file used to create the TinyDB db file using tempfile.TemporaryFile().

Self and name params only present so that subclasses of YawningTitanDB don’t break when instantiating the patched class.

tests.yawning_titan_db_patch.yawning_titan_db_test_defaults_patch(self, name)[source]#

Patch the YawningTitanDB so point to the tests/_package_data directory.