Пример #1
0
 def integration_01b_create_queue(self):
     actor = sqs.Create('Create %s' % self.queue_name, {
         'name': self.queue_name,
         'region': self.region
     })
     done = yield actor.execute()
     self.assertEquals(done, None)
Пример #2
0
    def test_execute_dry(self):
        self.actor = sqs.Create('Unit Test Action', {
            'name': 'unit-test-queue',
            'region': 'us-west-2'
        },
                                dry=True)

        self.sqs_conn().create_queue.return_value = boto.sqs.queue.Queue()
        yield self.actor.execute()
        self.assertFalse(self.sqs_conn().create_queue.called)
Пример #3
0
    def test_execute(self):
        self.actor = sqs.Create('Unit Test Action', {
            'name': 'unit-test-queue',
            'region': 'us-west-2'
        })

        self.sqs_conn().create_queue.return_value = boto.sqs.queue.Queue()
        ret = yield self.actor.execute()
        self.assertEquals(ret, None)
        self.sqs_conn().create_queue.assert_called_once_with('unit-test-queue')
Пример #4
0
    def test_execute_with_error(self):
        self.actor = sqs.Create('Unit Test Action', {
            'name': 'unit-test-queue',
            'region': 'us-west-2'
        })

        self.sqs_conn().create_queue.return_value = False

        with self.assertRaises(exceptions.UnrecoverableActorFailure):
            yield self.actor.execute()
        self.sqs_conn().create_queue.assert_called_once_with('unit-test-queue')