def test_run_exception(self, event_loop):
    'Test that run calls all units of purge process and checks the exception handling'

    @asyncio.coroutine
    def mock_audit_info():
        return ''
    mockStorageClient = MagicMock(spec=StorageClient)
    mockAuditLogger = AuditLogger(mockStorageClient)
    with patch.object(FoglampProcess, '__init__'):
        with patch.object(mockAuditLogger, '__init__', return_value=None):
            p = Purge(loop=event_loop)
            config = 'Some config'
            p._logger.exception = MagicMock()
            with patch.object(p, 'set_configuration', return_value=config):
                with patch.object(p, 'purge_data', return_value=Exception()):
                    with patch.object(p, 'write_statistics'):
                        p.run()
            p._logger.exception.assert_called_once_with("'Exception' object is not iterable")
Test that run calls all units of purge process and checks the exception handling
def test_run_exception(self, event_loop):
    

    @asyncio.coroutine
    def mock_audit_info():
        return 
    mockStorageClient = MagicMock(spec=StorageClient)
    mockAuditLogger = AuditLogger(mockStorageClient)
    with patch.object(FoglampProcess, '__init__'):
        with patch.object(mockAuditLogger, '__init__', return_value=None):
            p = Purge(loop=event_loop)
            config = 'Some config'
            p._logger.exception = MagicMock()
            with patch.object(p, 'set_configuration', return_value=config):
                with patch.object(p, 'purge_data', return_value=Exception()):
                    with patch.object(p, 'write_statistics'):
                        p.run()
            p._logger.exception.assert_called_once_with("'Exception' object is not iterable")