Ejemplo n.º 1
0
def test_get_tubes_with_all_tubes():
    mock_client = mock.Mock(spec=pystalk.BeanstalkClient)
    mock_client.list_tubes.return_value = ['foo', 'default']

    assert util.get_tubes(mock_client, []) == set(['foo', 'default'])

    assert util.get_tubes(mock_client, None) == set(['foo', 'default'])
Ejemplo n.º 2
0
def test_get_tubes_with_exact_list():
    mock_client = mock.Mock(spec=pystalk.BeanstalkClient)
    mock_client.list_tubes.return_value = ['foo', 'bar', 'default']

    assert util.get_tubes(mock_client, ['bar', 'foo']) == set(['foo', 'bar'])