# Path: stacker_blueprints/sqs.py
# class Queues(Blueprint):
#     """Manages the creation of SQS queues."""
# 
#     VARIABLES = {
#         "Queues": {
#             "type": TroposphereType(sqs.Queue, many=True),
#             "description": "Dictionary of SQS queue definitions",
#         },
#     }
# 
#     def create_template(self):
#         t = self.template
#         variables = self.get_variables()
# 
#         for queue in variables["Queues"]:
#             t.add_resource(queue)
#             t.add_output(
#                 Output(queue.title + "Arn", Value=GetAtt(queue, "Arn"))
#             )
#             t.add_output(Output(queue.title + "Url", Value=Ref(queue)))


import unittest
from stacker.context import Context
from stacker.variables import Variable
from stacker_blueprints.sqs import Queues
from stacker.blueprints.testutil import BlueprintTestCase

class TestBlueprint(BlueprintTestCase):
    def setUp(self):
        self.variables = [
            Variable('Queues', {
                'Simple': {
                    'DelaySeconds': 15,
                    'MaximumMessageSize': 4096,
                    'ReceiveMessageWaitTimeSeconds': 15,
                    'VisibilityTimeout': 600,
                },
                'Fifo': {
                    'FifoQueue': True,
                    'QueueName': 'Fifo.fifo',
                },
                'RedrivePolicy': {
                    'RedrivePolicy': {
                        'deadLetterTargetArn': 'arn:aws:sqs:us-east-1:123456789:dlq',
                        'maxReceiveCount': 3,
                    }
                }})
        ]

    def test_sqs(self):

# Path: stacker_blueprints/sqs.py
# class Queues(Blueprint):
#     """Manages the creation of SQS queues."""
# 
#     VARIABLES = {
#         "Queues": {
#             "type": TroposphereType(sqs.Queue, many=True),
#             "description": "Dictionary of SQS queue definitions",
#         },
#     }
# 
#     def create_template(self):
#         t = self.template
#         variables = self.get_variables()
# 
#         for queue in variables["Queues"]:
#             t.add_resource(queue)
#             t.add_output(
#                 Output(queue.title + "Arn", Value=GetAtt(queue, "Arn"))
#             )
#             t.add_output(Output(queue.title + "Url", Value=Ref(queue)))


# Path: tests/test_sqs.py
import unittest
from stacker.context import Context
from stacker.variables import Variable
from stacker_blueprints.sqs import Queues
from stacker.blueprints.testutil import BlueprintTestCase


class TestBlueprint(BlueprintTestCase):
    def setUp(self):
        self.variables = [
            Variable('Queues', {
                'Simple': {
                    'DelaySeconds': 15,
                    'MaximumMessageSize': 4096,
                    'ReceiveMessageWaitTimeSeconds': 15,
                    'VisibilityTimeout': 600,
                },
                'Fifo': {
                    'FifoQueue': True,
                    'QueueName': 'Fifo.fifo',
                },
                'RedrivePolicy': {
                    'RedrivePolicy': {
                        'deadLetterTargetArn': 'arn:aws:sqs:us-east-1:123456789:dlq',
                        'maxReceiveCount': 3,
                    }
                }})
        ]

    def test_sqs(self):

        ctx = Context({'namespace': 'test', 'environment': 'test'})