本文整理匯總了Python中profitbricks.client.ProfitBricksService.get_request方法的典型用法代碼示例。如果您正苦於以下問題:Python ProfitBricksService.get_request方法的具體用法?Python ProfitBricksService.get_request怎麽用?Python ProfitBricksService.get_request使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類profitbricks.client.ProfitBricksService
的用法示例。
在下文中一共展示了ProfitBricksService.get_request方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: TestProvisioningRequest
# 需要導入模塊: from profitbricks.client import ProfitBricksService [as 別名]
# 或者: from profitbricks.client.ProfitBricksService import get_request [as 別名]
class TestProvisioningRequest(unittest.TestCase):
def setUp(self):
self.provisioning_request = ProfitBricksService(username="username", password="password")
def test_list_requests(self):
prov_requests = self.provisioning_request.list_requests()
self.assertEqual(len(prov_requests), 4)
self.assertEqual(prov_requests["items"][0]["id"], "59359eae-cdcd-406f-900b-58b3ad9d8de9")
def test_get_request(self):
request_id = "59359eae-cdcd-406f-900b-58b3ad9d8de9"
prov_request = self.provisioning_request.get_request(request_id)
self.assertEqual(prov_request["metadata"]["createdBy"], "User X")
def test_get_request_with_status(self):
request_id = "59359eae-cdcd-406f-900b-58b3ad9d8de9"
prov_request = self.provisioning_request.get_request(request_id, status=True)
self.assertEqual(prov_request["metadata"]["requestStatus"], "RUNNING")