Exemplo n.º 1
0
 def test_SQSQueue_check_return_type(self):
     qq = hub.SQSQueue(self.qname)
     qq.create_and_send('some.id')
     sleep(self.delay)
     ev = qq.get_event()
     ev.delete()
     assert ev.__class__.__name__ == 'SQSEvent'
Exemplo n.º 2
0
 def test_SQSQueue_create_and_send(self):
     qq = hub.SQSQueue(self.qname)
     qq.create_and_send('silly.id')
     sleep(self.delay)
     ev = qq.get_event()
     ev.delete()
     assert ev.event_id == 'silly.id'
Exemplo n.º 3
0
 def test_SQSQueue_create_and_send_ordered_deleting(self):
     qq = hub.SQSQueue(self.qname)
     qq.create_and_send('some.id', data=dict(index=0))
     qq.create_and_send('some.id', data=dict(index=1))
     sleep(self.delay)
     evA = qq.get_event()
     evA.delete()
     evB = qq.get_event()
     evB.delete()
     # I'm using sets to accommodate weakly ordered responses
     indices = set([evA.data['index'], evB.data['index']])
     assert indices == set([0, 1])
Exemplo n.º 4
0
 def test_SQSQueue_event_factory_data(self):
     qq = hub.SQSQueue(self.qname)
     ev = qq.event_factory('abc', dict(a=42))
     assert ev.data == {'a': 42}
Exemplo n.º 5
0
 def test_SQSQueue_event_factory_name(self):
     qq = hub.SQSQueue(self.qname)
     ev = qq.event_factory('abc', dict(a=1))
     assert ev.event_id == 'abc'
Exemplo n.º 6
0
 def test_SQSQueue_conforms_to_interface(self):
     qq = hub.SQSQueue(self.qname)
     assert interface.IQueue in providedBy(qq)