def test_run(self, event_loop):
    'Test that run calls all units of purge process'

    @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) as mock_set_config:
                with patch.object(p, 'purge_data', return_value=(1, 2)) as mock_purge_data:
                    with patch.object(p, 'write_statistics') as mock_write_stats:
                        p.run()
            mock_set_config.assert_called_once_with()
            mock_purge_data.assert_called_once_with(config)
            mock_write_stats.assert_called_once_with(1, 2)
Test that run calls all units of purge process
def test_run(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) as mock_set_config:
                with patch.object(p, 'purge_data', return_value=(1, 2)) as mock_purge_data:
                    with patch.object(p, 'write_statistics') as mock_write_stats:
                        p.run()
            mock_set_config.assert_called_once_with()
            mock_purge_data.assert_called_once_with(config)
            mock_write_stats.assert_called_once_with(1, 2)