code formatting
This commit is contained in:
parent
7e4340e7e4
commit
29b69a7d5d
@ -321,7 +321,6 @@ class MockCloudProvider(CloudProviderInterface):
|
|||||||
self._maybe_raise(self.UNAUTHORIZED_RATE, self.AUTHORIZATION_EXCEPTION)
|
self._maybe_raise(self.UNAUTHORIZED_RATE, self.AUTHORIZATION_EXCEPTION)
|
||||||
return TenantAdminOwnershipCSPResult(**dict(id="admin_owner_assignment_id"))
|
return TenantAdminOwnershipCSPResult(**dict(id="admin_owner_assignment_id"))
|
||||||
|
|
||||||
|
|
||||||
def create_tenant_principal_ownership(
|
def create_tenant_principal_ownership(
|
||||||
self, payload: TenantPrincipalOwnershipCSPPayload
|
self, payload: TenantPrincipalOwnershipCSPPayload
|
||||||
):
|
):
|
||||||
|
@ -445,6 +445,7 @@ def test_create_billing_instruction(mock_azure: AzureCloudProvider):
|
|||||||
body: BillingInstructionCSPResult = result.get("body")
|
body: BillingInstructionCSPResult = result.get("body")
|
||||||
assert body.reported_clin_name == "TO1:CLIN001"
|
assert body.reported_clin_name == "TO1:CLIN001"
|
||||||
|
|
||||||
|
|
||||||
def test_create_product_purchase(mock_azure: AzureCloudProvider):
|
def test_create_product_purchase(mock_azure: AzureCloudProvider):
|
||||||
mock_azure.sdk.adal.AuthenticationContext.return_value.context.acquire_token_with_client_credentials.return_value = {
|
mock_azure.sdk.adal.AuthenticationContext.return_value.context.acquire_token_with_client_credentials.return_value = {
|
||||||
"accessToken": "TOKEN"
|
"accessToken": "TOKEN"
|
||||||
@ -464,9 +465,7 @@ def test_create_product_purchase(mock_azure: AzureCloudProvider):
|
|||||||
tenant_id="6d2d2d6c-a6d6-41e1-8bb1-73d11475f8f4",
|
tenant_id="6d2d2d6c-a6d6-41e1-8bb1-73d11475f8f4",
|
||||||
type="AADPremium",
|
type="AADPremium",
|
||||||
sku="AADP1",
|
sku="AADP1",
|
||||||
productProperties={
|
productProperties={"beneficiaryTenantId": str(uuid4()),},
|
||||||
"beneficiaryTenantId": str(uuid4()),
|
|
||||||
},
|
|
||||||
quantity=4,
|
quantity=4,
|
||||||
billing_account_name="7c89b735-b22b-55c0-ab5a-c624843e8bf6:de4416ce-acc6-44b1-8122-c87c4e903c91_2019-05-31",
|
billing_account_name="7c89b735-b22b-55c0-ab5a-c624843e8bf6:de4416ce-acc6-44b1-8122-c87c4e903c91_2019-05-31",
|
||||||
billing_profile_name="KQWI-W2SU-BG7-TGB",
|
billing_profile_name="KQWI-W2SU-BG7-TGB",
|
||||||
@ -476,9 +475,11 @@ def test_create_product_purchase(mock_azure: AzureCloudProvider):
|
|||||||
result = mock_azure.create_product_purchase(payload)
|
result = mock_azure.create_product_purchase(payload)
|
||||||
body: ProductPurchaseCSPResult = result.get("body")
|
body: ProductPurchaseCSPResult = result.get("body")
|
||||||
assert (
|
assert (
|
||||||
body.product_purchase_verify_url == "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/7c89b735-b22b-55c0-ab5a-c624843e8bf6:de4416ce-acc6-44b1-8122-c87c4e903c91_2019-05-31/operationResults/patchBillingProfile_KQWI-W2SU-BG7-TGB:02715576-4118-466c-bca7-b1cd3169ff46?api-version=2019-10-01-preview"
|
body.product_purchase_verify_url
|
||||||
|
== "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/7c89b735-b22b-55c0-ab5a-c624843e8bf6:de4416ce-acc6-44b1-8122-c87c4e903c91_2019-05-31/operationResults/patchBillingProfile_KQWI-W2SU-BG7-TGB:02715576-4118-466c-bca7-b1cd3169ff46?api-version=2019-10-01-preview"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_create_product_purchase_verification(mock_azure):
|
def test_create_product_purchase_verification(mock_azure):
|
||||||
mock_azure.sdk.adal.AuthenticationContext.return_value.context.acquire_token_with_client_credentials.return_value = {
|
mock_azure.sdk.adal.AuthenticationContext.return_value.context.acquire_token_with_client_credentials.return_value = {
|
||||||
"accessToken": "TOKEN"
|
"accessToken": "TOKEN"
|
||||||
@ -493,29 +494,26 @@ def test_create_product_purchase_verification(mock_azure):
|
|||||||
"name": "string",
|
"name": "string",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"properties": {
|
"properties": {
|
||||||
"displayName": "string",
|
"displayName": "string",
|
||||||
"purchaseDate": "2020-01-30T18:57:05.981Z",
|
"purchaseDate": "2020-01-30T18:57:05.981Z",
|
||||||
"productTypeId": "string",
|
"productTypeId": "string",
|
||||||
"productType": "string",
|
"productType": "string",
|
||||||
"status": "Active",
|
"status": "Active",
|
||||||
"endDate": "2020-01-30T18:57:05.981Z",
|
"endDate": "2020-01-30T18:57:05.981Z",
|
||||||
"billingFrequency": "OneTime",
|
"billingFrequency": "OneTime",
|
||||||
"lastCharge": {
|
"lastCharge": {"currency": "string", "value": 0},
|
||||||
"currency": "string",
|
"lastChargeDate": "2020-01-30T18:57:05.981Z",
|
||||||
"value": 0
|
"quantity": 0,
|
||||||
|
"skuId": "string",
|
||||||
|
"skuDescription": "string",
|
||||||
|
"availabilityId": "string",
|
||||||
|
"parentProductId": "string",
|
||||||
|
"invoiceSectionId": "string",
|
||||||
|
"invoiceSectionDisplayName": "string",
|
||||||
|
"billingProfileId": "string",
|
||||||
|
"billingProfileDisplayName": "string",
|
||||||
},
|
},
|
||||||
"lastChargeDate": "2020-01-30T18:57:05.981Z",
|
},
|
||||||
"quantity": 0,
|
|
||||||
"skuId": "string",
|
|
||||||
"skuDescription": "string",
|
|
||||||
"availabilityId": "string",
|
|
||||||
"parentProductId": "string",
|
|
||||||
"invoiceSectionId": "string",
|
|
||||||
"invoiceSectionDisplayName": "string",
|
|
||||||
"billingProfileId": "string",
|
|
||||||
"billingProfileDisplayName": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mock_azure.sdk.requests.get.return_value = mock_result
|
mock_azure.sdk.requests.get.return_value = mock_result
|
||||||
@ -531,6 +529,7 @@ def test_create_product_purchase_verification(mock_azure):
|
|||||||
body: ProductPurchaseVerificationCSPResult = result.get("body")
|
body: ProductPurchaseVerificationCSPResult = result.get("body")
|
||||||
assert body.premium_purchase_date == "2020-01-30T18:57:05.981Z"
|
assert body.premium_purchase_date == "2020-01-30T18:57:05.981Z"
|
||||||
|
|
||||||
|
|
||||||
def test_create_tenant_principal_app(mock_azure: AzureCloudProvider):
|
def test_create_tenant_principal_app(mock_azure: AzureCloudProvider):
|
||||||
with patch.object(
|
with patch.object(
|
||||||
AzureCloudProvider,
|
AzureCloudProvider,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user