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', ])
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' } }
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' } }