# Path: kale/queue_info.py
# class TaskQueue(object):
# class QueueInfoBase(object):
# class QueueInfo(QueueInfoBase):
#     def __init__(self, name='default', priority=5, num_iterations=2,
#                  long_poll_time_sec=5, batch_size=5,
#                  visibility_timeout_sec=600):
#     def _decorate_name(self, name):
#     def get_queues(self):
#     def get_highest_priority_queue_that_needs_work(self):
#     def is_queue_empty(self, queue):
#     def does_queue_need_work(self, queue):
#     def __init__(self, config_file, sqs_talk, queue_cls=TaskQueue):
#     def get_queue(self, simple_name):
#     def get_queues(self):
#     def get_highest_priority_queue_that_needs_work(self):
#     def is_queue_empty(self, queue):
#     def does_queue_need_work(self, queue):
#     def _get_queues_from_config(cls, config_file, queue_cls):
# 
# Path: kale/queue_selector.py
# class SelectQueueBase(object):
# class Random(SelectQueueBase):
# class Lottery(SelectQueueBase):
# class HighestPriorityFirst(SelectQueueBase):
# class HighestPriorityLottery(Lottery):
# class LotteryLottery(Lottery):
# class ReducedLottery(Lottery):
#     def __init__(self, queue_info):
#     def get_queue(self, *args, **kwargs):
#     def get_queue(self):
#     def _run_lottery(queues):
#     def get_queue(self, *args, **kwargs):
#     def get_queue(self, *args, **kwargs):
#     def get_queue(self, *args, **kwargs):
#     def get_queue(self, *args, **kwargs):
#     def get_queue(self, *args, **kwargs):


import unittest
from kale import queue_info
from kale import queue_selector
    """Tests for ReducedLottery class."""

    def get_queue_test(self):
        selector = queue_selector.ReducedLottery(MultiQueueInfo())
        queue = selector.get_queue()
        self.assertEqual(queue.name, 'queue2')


class HighestPriorityLotteryTest(unittest.TestCase):
    """Tests for HighestPriorityLottery class."""

    def run_lottery_test(self):
        queue = queue_selector.HighestPriorityLottery._run_lottery(
            MultiQueueInfo().get_queues())
        self.assertTrue(queue.name in ['queue1', 'queue2', 'queue3'])

        queue = queue_selector.HighestPriorityLottery._run_lottery(
            SingleQueueInfo().get_queues())
        self.assertEqual(queue.name, 'queue1')

        queue = queue_selector.HighestPriorityLottery._run_lottery(
            NoQueueInfo().get_queues())
        self.assertIsNone(queue)

        queue = queue_selector.HighestPriorityLottery._run_lottery(
            BadQueueInfo().get_queues())
        self.assertIsNone(queue)

    def get_queue_test(self):
        # Get any one queue from multiple queues

# Path: kale/queue_info.py
# class TaskQueue(object):
# class QueueInfoBase(object):
# class QueueInfo(QueueInfoBase):
#     def __init__(self, name='default', priority=5, num_iterations=2,
#                  long_poll_time_sec=5, batch_size=5,
#                  visibility_timeout_sec=600):
#     def _decorate_name(self, name):
#     def get_queues(self):
#     def get_highest_priority_queue_that_needs_work(self):
#     def is_queue_empty(self, queue):
#     def does_queue_need_work(self, queue):
#     def __init__(self, config_file, sqs_talk, queue_cls=TaskQueue):
#     def get_queue(self, simple_name):
#     def get_queues(self):
#     def get_highest_priority_queue_that_needs_work(self):
#     def is_queue_empty(self, queue):
#     def does_queue_need_work(self, queue):
#     def _get_queues_from_config(cls, config_file, queue_cls):
# 
# Path: kale/queue_selector.py
# class SelectQueueBase(object):
# class Random(SelectQueueBase):
# class Lottery(SelectQueueBase):
# class HighestPriorityFirst(SelectQueueBase):
# class HighestPriorityLottery(Lottery):
# class LotteryLottery(Lottery):
# class ReducedLottery(Lottery):
#     def __init__(self, queue_info):
#     def get_queue(self, *args, **kwargs):
#     def get_queue(self):
#     def _run_lottery(queues):
#     def get_queue(self, *args, **kwargs):
#     def get_queue(self, *args, **kwargs):
#     def get_queue(self, *args, **kwargs):
#     def get_queue(self, *args, **kwargs):
#     def get_queue(self, *args, **kwargs):


# Path: kale/tests/test_queue_selector.py
import unittest
from kale import queue_info
from kale import queue_selector

    """Tests for ReducedLottery class."""

    def get_queue_test(self):
        selector = queue_selector.ReducedLottery(MultiQueueInfo())
        queue = selector.get_queue()
        self.assertEqual(queue.name, 'queue2')


class HighestPriorityLotteryTest(unittest.TestCase):
    """Tests for HighestPriorityLottery class."""

    def run_lottery_test(self):
        queue = queue_selector.HighestPriorityLottery._run_lottery(
            MultiQueueInfo().get_queues())
        self.assertTrue(queue.name in ['queue1', 'queue2', 'queue3'])

        queue = queue_selector.HighestPriorityLottery._run_lottery(
            SingleQueueInfo().get_queues())
        self.assertEqual(queue.name, 'queue1')

        queue = queue_selector.HighestPriorityLottery._run_lottery(
            NoQueueInfo().get_queues())
        self.assertIsNone(queue)

        queue = queue_selector.HighestPriorityLottery._run_lottery(
            BadQueueInfo().get_queues())
        self.assertIsNone(queue)

    def get_queue_test(self):
        # Get any one queue from multiple queues

        selector = queue_selector.HighestPriorityLottery(MultiQueueInfo())