def test_set_configuration(self, event_loop):
    "Test that purge's set_configuration returns configuration item with key 'PURGE_READ' "

    @asyncio.coroutine
    def mock_cm_return():
        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)
            p._storage = MagicMock(spec=StorageClient)
            mock_cm = ConfigurationManager(p._storage)
            with patch.object(mock_cm, 'create_category', return_value=mock_cm_return()) as mock_create_cat:
                with patch.object(mock_cm, 'get_category_all_items', return_value=mock_cm_return()) as mock_get_cat:
                    p.set_configuration()
                    mock_get_cat.assert_called_once_with('PURGE_READ')
                (args, kwargs) = mock_create_cat.call_args
                assert (len(args) == 3)
                assert (args[0] == 'PURGE_READ')
Test that purge's set_configuration returns configuration item with key 'PURGE_READ'
def test_set_configuration(self, event_loop):
    " "

    @asyncio.coroutine
    def mock_cm_return():
        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)
            p._storage = MagicMock(spec=StorageClient)
            mock_cm = ConfigurationManager(p._storage)
            with patch.object(mock_cm, 'create_category', return_value=mock_cm_return()) as mock_create_cat:
                with patch.object(mock_cm, 'get_category_all_items', return_value=mock_cm_return()) as mock_get_cat:
                    p.set_configuration()
                    mock_get_cat.assert_called_once_with('PURGE_READ')
                (args, kwargs) = mock_create_cat.call_args
                assert (len(args) == 3)
                assert (args[0] == 'PURGE_READ')