Testing¶
Testing utilities for Bio2BEL.
This module has tools for quickly writing unit tests with unittest
that involve the usage of a mock data with
a Bio2BEL manager.
-
class
bio2bel.testing.
TemporaryConnectionMethodMixin
(methodName='runTest')[source]¶ Creates a
unittest.TestCase
that has a persistent file for use with SQLite during testing.Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
-
class
bio2bel.testing.
TemporaryConnectionMixin
(methodName='runTest')[source]¶ Creates a
unittest.TestCase
that has a persistent file for use with SQLite during testing.Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
-
class
bio2bel.testing.
MockConnectionMixin
(methodName='runTest')[source]¶ Allows for testing with a consistent connection without changing the configuration.
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
-
class
bio2bel.testing.
AbstractTemporaryCacheMethodMixin
(methodName='runTest')[source]¶ Allows for testing with a consistent connection and creation of a manager class wrapping that connection.
Requires the class variable
Manager
to be overriden with the class corresponding to the manager to be used that is a subclass ofbio2bel.AbstractManager
.Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
-
class
bio2bel.testing.
AbstractTemporaryCacheClassMixin
(methodName='runTest')[source]¶ Allows for testing with a consistent connection and creation of a manager class wrapping that connection.
Requires the class variable
Manager
to be overriden with the class corresponding to the manager to be used that is a subclass ofbio2bel.AbstractManager
.Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
-
classmethod
setUpClass
()[source]¶ Set up the class with the given manager and allows an optional populate hook to be overridden.
-
classmethod