def test_initialized(self, initialize, _load_test_config): """ Assert that the function is a noop when the connection is already initialized. """ base.start_database_connection() self.assertEqual(_load_test_config.call_count, 0) self.assertEqual(initialize.call_count, 0)
def test_not_initialized(self, initialize, _load_test_config): """ Assert that the function starts the connection when the connection is not already initialized. """ base.start_database_connection() _load_test_config.assert_called_once_with() initialize.assert_called_once_with()
def setup(): """ Set up the database connection for the tests to use. """ devel_base.start_database_connection()