Python moto.mock_sqs() Examples
The following are 16
code examples of moto.mock_sqs().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
moto
, or try the search function
.
Example #1
Source File: conftest.py From historical with Apache License 2.0 | 6 votes |
def historical_sqs(): """Create the Mocked SQS queues that are used throughout Historical.""" with mock_sqs(): client = boto3.client('sqs', region_name='us-east-1') # Poller Tasker Queue: client.create_queue(QueueName='pollertaskerqueue') os.environ['POLLER_TASKER_QUEUE_NAME'] = 'pollertaskerqueue' # Poller Queue: client.create_queue(QueueName='pollerqueue') os.environ['POLLER_QUEUE_NAME'] = 'pollerqueue' # Event Queue: client.create_queue(QueueName='eventqueue') os.environ['EVENT_QUEUE_NAME'] = 'eventqueue' # Proxy Queue: client.create_queue(QueueName='proxyqueue') yield client
Example #2
Source File: environment.py From clusterman with Apache License 2.0 | 6 votes |
def boto_patches(context): mock_sqs_obj = mock_sqs() mock_sqs_obj.start() mock_ec2_obj = mock_ec2() mock_ec2_obj.start() mock_autoscaling_obj = mock_autoscaling() mock_autoscaling_obj.start() vpc_response = ec2.create_vpc(CidrBlock='10.0.0.0/24') subnet_response = ec2.create_subnet( CidrBlock='10.0.0.0/24', VpcId=vpc_response['Vpc']['VpcId'], AvailabilityZone='us-west-2a' ) context.subnet_id = subnet_response['Subnet']['SubnetId'] yield mock_sqs_obj.stop() mock_ec2_obj.stop() mock_autoscaling_obj.stop()
Example #3
Source File: test_dlq.py From aws-auto-remediate with GNU General Public License v3.0 | 5 votes |
def retry(self): with moto.mock_sqs(): retry = lambda_handler.Retry(logging) yield retry
Example #4
Source File: test_dlq.py From aws-auto-remediate with GNU General Public License v3.0 | 5 votes |
def retry(self): with moto.mock_sqs(): retry = lambda_handler.Retry(logging) yield retry
Example #5
Source File: test_dlq.py From aws-auto-remediate with GNU General Public License v3.0 | 5 votes |
def retry(self): with moto.mock_sqs(): retry = lambda_handler.Retry(logging) yield retry
Example #6
Source File: test_repository_listener.py From github-snooze-button with MIT License | 5 votes |
def decorate(cls, func): return moto.mock_sqs(moto.mock_sns(responses.activate(func)))
Example #7
Source File: setup.py From boss with Apache License 2.0 | 5 votes |
def __init__(self): self.mock_sqs = None
Example #8
Source File: setup.py From boss with Apache License 2.0 | 5 votes |
def start_mocking(self): """Method to start mocking""" self.mock = True self.mock_sqs = mock_sqs() self.mock_sqs.start()
Example #9
Source File: setup.py From boss with Apache License 2.0 | 5 votes |
def stop_mocking(self): """Method to stop mocking""" self.mock_sqs.stop() # ***** Upload Task SQS Queue *****
Example #10
Source File: setup.py From boss with Apache License 2.0 | 5 votes |
def create_upload_queue(self, queue_name): """Method to create a test sqs for uploading tiles for the ingest""" if self.mock: url = mock_sqs(self._create_upload_queue(queue_name)) else: url = self._create_upload_queue(queue_name) time.sleep(30) return url
Example #11
Source File: setup.py From boss with Apache License 2.0 | 5 votes |
def delete_upload_queue(self, queue_name): """Method to delete a test sqs for uploading tiles for the ingest""" if self.mock: mock_sqs(self._delete_upload_queue(queue_name)) else: self._delete_upload_queue(queue_name) # ***** END Flush SQS Queue *****
Example #12
Source File: conftest.py From raven-python-lambda with Apache License 2.0 | 5 votes |
def sqs(): with mock_sqs(): yield boto3.client("sqs", region_name="us-east-1")
Example #13
Source File: test_consumer.py From ndkale with BSD 2-Clause "Simplified" License | 5 votes |
def setUp(self): self.mock_sqs = mock_sqs() self.mock_sqs.start() sqs.SQSTalk._queues = {}
Example #14
Source File: test_consumer.py From ndkale with BSD 2-Clause "Simplified" License | 5 votes |
def tearDown(self): self.mock_sqs.stop()
Example #15
Source File: test_sqs.py From ndkale with BSD 2-Clause "Simplified" License | 5 votes |
def setUp(self): self.mock_sqs = mock_sqs() self.mock_sqs.start() sqs.SQSTalk._queues = {}
Example #16
Source File: test_sqs.py From ndkale with BSD 2-Clause "Simplified" License | 5 votes |
def tearDown(self): self.mock_sqs.stop()