Skip to content

Commit 2734635

Browse files
committed
update from origin
1 parent a61b4be commit 2734635

File tree

3 files changed

+56
-3
lines changed

3 files changed

+56
-3
lines changed

SoftLayer/fixtures/SoftLayer_Billing_Order.py

+25
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,28 @@
4545
'orderApprovalDate': '2019-09-15T13:13:13-06:00',
4646
'orderTotalAmount': '0'
4747
}]
48+
49+
getObject = {
50+
'accountId': 1234,
51+
'createDate': '2020-09-23T16:22:30-06:00',
52+
'id': 6543210,
53+
'impersonatingUserRecordId': None,
54+
'initialInvoice': {
55+
'amount': '0',
56+
'id': 60012345,
57+
'invoiceTotalAmount': '0'
58+
},
59+
'items': [{
60+
'description': 'Dual Intel Xeon Silver 4210 (20 Cores, 2.20 GHz)'
61+
}],
62+
'modifyDate': '2020-09-23T16:22:32-06:00',
63+
'orderQuoteId': None,
64+
'orderTypeId': 11,
65+
'presaleEventId': None,
66+
'privateCloudOrderFlag': False,
67+
'status': 'APPROVED',
68+
'userRecord': {
69+
'displayName': 'testUser'
70+
},
71+
'userRecordId': 7654321,
72+
}

tests/CLI/modules/order_tests.py

+7
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,13 @@ def _get_verified_order_return(self):
406406
'recurringFee': '150'}
407407
return {'orderContainers': [{'prices': [price1, price2]}]}
408408

409+
def test_order_lookup(self):
410+
result = self.run_command(['order', 'lookup', '12345'])
411+
self.assert_no_fail(result)
412+
self.assert_called_with('SoftLayer_Billing_Order', 'getObject', identifier='12345')
413+
self.assertIn('Ordered By', result.output)
414+
self.assertIn('Initial Invoice', result.output)
415+
409416

410417
def _get_all_packages():
411418
package_type = {'keyName': 'BARE_METAL_CPU'}

tests/managers/ordering_tests.py

+24-3
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ def test_get_item_capacity_core(self):
731731
"capacity": "1",
732732
"id": 10201,
733733
"keyName": "GUEST_CORE_1_DEDICATED",
734-
}]
734+
}]
735735

736736
item_capacity = self.ordering.get_item_capacity(items, ['GUEST_CORE_1_DEDICATED', 'OS_RHEL_7_X_LAMP_64_BIT'])
737737

@@ -748,7 +748,7 @@ def test_get_item_capacity_storage(self):
748748
"capacity": "1",
749749
"id": 10201,
750750
"keyName": "READHEAVY_TIER",
751-
}]
751+
}]
752752

753753
item_capacity = self.ordering.get_item_capacity(items, ['READHEAVY_TIER', 'STORAGE_SPACE_FOR_2_IOPS_PER_GB'])
754754

@@ -766,7 +766,7 @@ def test_get_item_capacity_intel(self):
766766
"capacity": "1",
767767
"id": 10201,
768768
"keyName": "GUEST_CORE_1_DEDICATED",
769-
}]
769+
}]
770770

771771
item_capacity = self.ordering.get_item_capacity(items, ['INTEL_XEON_2690_2_60', 'BANDWIDTH_20000_GB'])
772772

@@ -805,3 +805,24 @@ def test_get_item_prices_by_location(self):
805805

806806
self.assertEqual(options[0]['item']['keyName'], item_prices[0]['item']['keyName'])
807807
self.assertEqual(options[0]['hourlyRecurringFee'], item_prices[0]['hourlyRecurringFee'])
808+
809+
def test_get_oder_detail_mask(self):
810+
order_id = 12345
811+
test_mask = 'mask[id]'
812+
self.ordering.get_order_detail(order_id, mask=test_mask)
813+
self.assert_called_with('SoftLayer_Billing_Order', 'getObject', identifier=order_id, mask=test_mask)
814+
815+
def test_get_oder_detail_default_mask(self):
816+
order_id = 12345
817+
_default_mask = (
818+
'mask[orderTotalAmount,orderApprovalDate,'
819+
'initialInvoice[id,amount,invoiceTotalAmount,'
820+
'invoiceTopLevelItems[id, description, hostName, domainName, oneTimeAfterTaxAmount,'
821+
'recurringAfterTaxAmount, createDate,'
822+
'categoryCode,'
823+
'category[name],'
824+
'location[name],'
825+
'children[id, category[name], description, oneTimeAfterTaxAmount,recurringAfterTaxAmount]]],'
826+
'items[description],userRecord[displayName,userStatus]]')
827+
self.ordering.get_order_detail(order_id)
828+
self.assert_called_with('SoftLayer_Billing_Order', 'getObject', identifier=order_id, mask=_default_mask)

0 commit comments

Comments
 (0)