

def test_LogError_shows_error_message_when_DB_is_unavailable(self):
    db_mock = flexmock()
    db_mock.should_receive('AddError').and_raise(AttributeError).once()
    error_handler.core_mock.DB = db_mock
    error_handler = self._create_error_handler_with_core_mock()
    self.init_stdout_recording()
    error_handler.LogError('Error message')
    stdout_content = self.get_recorded_stdout_and_close()
    assert_that((stdout_content is not None))

dataset/ETHPy150Open owtf/owtf/tests/test_cases/framework/error_handler_tests.py ErrorHandlerTests.test_LogError_shows_error_message_when_DB_is_unavailable/VarMisuse@32/57 `self`->`error_handler`