moto/tests/test_core/test_nested.py

30 lines
736 B
Python
Raw Normal View History

from __future__ import unicode_literals
import unittest
from boto.sqs.connection import SQSConnection
from boto.sqs.message import Message
from boto.ec2 import EC2Connection
2017-02-16 03:35:45 +00:00
from moto import mock_sqs_deprecated, mock_ec2_deprecated
from tests import EXAMPLE_AMI_ID
class TestNestedDecorators(unittest.TestCase):
2017-02-16 03:35:45 +00:00
@mock_sqs_deprecated
def setup_sqs_queue(self):
conn = SQSConnection()
2019-10-31 15:44:26 +00:00
q = conn.create_queue("some-queue")
m = Message()
2019-10-31 15:44:26 +00:00
m.set_body("This is my first message.")
q.write(m)
self.assertEqual(q.count(), 1)
2017-02-16 03:35:45 +00:00
@mock_ec2_deprecated
def test_nested(self):
self.setup_sqs_queue()
conn = EC2Connection()
conn.run_instances(EXAMPLE_AMI_ID)