MCPcopy Create free account
hub / github.com/Azure/azure-storage-python / test_sas_process

Method test_sas_process

tests/queues/test_queue.py:576–604  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

574 self.assertEqual(u'updatedmessage1', result[0].content)
575
576 def test_sas_process(self):
577 # SAS URL is calculated from storage key, so this test runs live only
578 if TestMode.need_recording_file(self.test_mode):
579 return
580
581 # Arrange
582 queue_name = self._create_queue()
583 self.qs.put_message(queue_name, u'message1')
584 token = self.qs.generate_queue_shared_access_signature(
585 queue_name,
586 QueuePermissions.PROCESS,
587 datetime.utcnow() + timedelta(hours=1),
588 )
589
590 # Act
591 service = QueueService(
592 account_name=self.settings.STORAGE_ACCOUNT_NAME,
593 sas_token=token,
594 )
595 self._set_test_proxy(service, self.settings)
596 result = service.get_messages(queue_name)
597
598 # Assert
599 self.assertIsNotNone(result)
600 self.assertEqual(1, len(result))
601 message = result[0]
602 self.assertIsNotNone(message)
603 self.assertNotEqual('', message.id)
604 self.assertEqual(u'message1', message.content)
605
606 def test_sas_signed_identifier(self):
607 # SAS URL is calculated from storage key, so this test runs live only

Callers

nothing calls this directly

Calls 8

_create_queueMethod · 0.95
get_messagesMethod · 0.95
QueueServiceClass · 0.90
need_recording_fileMethod · 0.80
_set_test_proxyMethod · 0.80
assertIsNotNoneMethod · 0.80
put_messageMethod · 0.45

Tested by

no test coverage detected