Пример #1
0
    def test_full_integration(self):
        queue = sqs.get_queue('test')
        queue.add_message({'message_type': 'sample', 'test': 'hello'})

        with self.assertRaises(SampleCalledException):
            task = SampleQueueTask()
            task.run_once()
Пример #2
0
 def test_multiple(self):
     with self.assertRaises(SampleCalledException):
         task = SampleQueueTask()
         task.process([{
             'message_type': 'sample',
             'test': 'hello'
         }, {
             'message_type': 'sample',
             'test': 'hello again'
         }])
Пример #3
0
 def test_unknown_message(self):
     with self.assertRaises(MessageError):
         task = SampleQueueTask()
         task.process([{
             'message_type': 'nonsample',
         }])
Пример #4
0
 def test_simple(self):
     with self.assertRaises(SampleCalledException):
         task = SampleQueueTask()
         task.process({'message_type': 'sample', 'test': 'hello'})