Exemplo n.º 1
0
 def test_update_nopop(self):
     queue = StorageQueueContext(**testconfig)
     queue.register_model(QueueOne())
     message = QueueOne(epgid=1, resolution='test_get_nothide')
     queue.put(message)
     message.pop_receipt = None
     with pytest.raises(AzureStorageWrapException):
         updatemessage = queue.update(message)
Exemplo n.º 2
0
    def test_update_nothide(self):
        queue = StorageQueueContext(**testconfig)
        queue.register_model(QueueOne())
        message = QueueOne(epgid=1, resolution='test_get_nothide')
        queue.put(message)

        getmessage = queue.get(QueueOne(), hide=1)
        assert getmessage.epgid == 1 and getmessage.resolution == 'test_get_nothide'

        time.sleep(1)

        getmessage.epgid = 999

        testmessage = queue.update(getmessage)
        assert testmessage.epgid == 999 and getmessage.resolution == 'test_get_nothide'

        queue.delete(testmessage)