Esempio n. 1
0
def test_worker_settings_parse_queues_errors_handline():
    ''' test for parsing queues and errors handling
    '''
    assert Settings.parse_gueues({'name': 'default'}) == {}

    with pytest.raises(TypeError):
        Settings.parse_gueues([
            'default',
        ])
Esempio n. 2
0
def test_worker_settings_parse_queues_as_default():
    ''' test for worker settings with parsing defaults
    '''
    assert Settings.parse_gueues(None) == {
        'default': {
            'events': [],
            'refs': None
        }
    }

    assert Settings.parse_gueues('source-queue') == {
        'default': {
            'events': [],
            'refs': 'source-queue'
        }
    }
Esempio n. 3
0
def test_worker_settings_parse_queues_as_list():
    ''' test for parsing queues specified as list
    '''
    assert Settings.parse_gueues([{
        'name': 'default'
    }]) == {
        'default': {
            'events': [],
            'refs': None
        }
    }

    assert Settings.parse_gueues([
        {
            'name': 'default',
            'refs': 'source'
        },
    ]) == {
        'default': {
            'events': [],
            'refs': 'source'
        }
    }