# Path: ecs_scheduler/triggers.py
# def init():
# def get(trigger_name):
#     def determine_task_count(self, job_data):
#     def __init__(self):
#     def determine_task_count(self, job_data):
#     def _calculate_task_count(self, message_count, job_data):
# class NoOpTrigger:
# class SqsTrigger:


import unittest
from unittest.mock import patch, Mock
from ecs_scheduler.triggers import (
    NoOpTrigger, SqsTrigger, get, init, _triggers
)
        }
        fake_queue = Mock(attributes={'ApproximateNumberOfMessages': 2})
        self._trigger._sqs.get_queue_by_name.return_value = fake_queue

        count = self._trigger.determine_task_count(test_data)

        self.assertEqual(1, count)

    def test_determine_task_count_returns_task_count_if_calculated_value_lower(
        self
    ):
        test_data = {
            'taskCount': 3,
            'trigger': {'queueName': 'testQueue', 'messagesPerTask': 10},
        }
        fake_queue = Mock(attributes={'ApproximateNumberOfMessages': 10})
        self._trigger._sqs.get_queue_by_name.return_value = fake_queue

        count = self._trigger.determine_task_count(test_data)

        self.assertEqual(3, count)


@patch('boto3.resource')
@patch.dict('ecs_scheduler.triggers._triggers', {})
class InitTests(unittest.TestCase):
    def test(self, fake_resource):
        init()

        self.assertEqual(2, len(_triggers))

# Path: ecs_scheduler/triggers.py
# def init():
# def get(trigger_name):
#     def determine_task_count(self, job_data):
#     def __init__(self):
#     def determine_task_count(self, job_data):
#     def _calculate_task_count(self, message_count, job_data):
# class NoOpTrigger:
# class SqsTrigger:


# Path: test/test_triggers.py
import unittest
from unittest.mock import patch, Mock
from ecs_scheduler.triggers import (
    NoOpTrigger, SqsTrigger, get, init, _triggers
)

        }
        fake_queue = Mock(attributes={'ApproximateNumberOfMessages': 2})
        self._trigger._sqs.get_queue_by_name.return_value = fake_queue

        count = self._trigger.determine_task_count(test_data)

        self.assertEqual(1, count)

    def test_determine_task_count_returns_task_count_if_calculated_value_lower(
        self
    ):
        test_data = {
            'taskCount': 3,
            'trigger': {'queueName': 'testQueue', 'messagesPerTask': 10},
        }
        fake_queue = Mock(attributes={'ApproximateNumberOfMessages': 10})
        self._trigger._sqs.get_queue_by_name.return_value = fake_queue

        count = self._trigger.determine_task_count(test_data)

        self.assertEqual(3, count)


@patch('boto3.resource')
@patch.dict('ecs_scheduler.triggers._triggers', {})
class InitTests(unittest.TestCase):
    def test(self, fake_resource):
        init()

        self.assertEqual(2, len(_triggers))

        self.assertIsInstance(_triggers['sqs'], SqsTrigger)