Skip to content

Commit 28a4e63

Browse files
author
Fernando Ojeda
committed
fixed vs create flavor test
1 parent a2b18ef commit 28a4e63

File tree

2 files changed

+51
-38
lines changed

2 files changed

+51
-38
lines changed

SoftLayer/fixtures/SoftLayer_Product_Package_Preset.py

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,45 @@
11
getObject = {
2-
"description": "AC1.8x60x25\r\n",
32
"id": 405,
4-
"isActive": "1",
53
"keyName": "AC1_8X60X25",
6-
"name": "AC1.8x60x25",
7-
"packageId": 835,
84
"prices": [
95
{
106
"hourlyRecurringFee": "1.425",
117
"id": 207345,
12-
"oneTimeFee": "0",
138
"recurringFee": "936.23",
149
"item": {
15-
"capacity": "1",
1610
"description": "1 x P100 GPU",
1711
"id": 10933,
1812
"keyName": "1_X_P100_GPU",
19-
"itemCategory": {
20-
"categoryCode": "guest_pcie_device0",
21-
"id": 1259,
22-
"name": "PCIe Device - GPU",
23-
}
2413
}
2514
},
2615
{
2716
"hourlyRecurringFee": "0",
2817
"id": 2202,
29-
"itemId": 1178,
30-
"laborFee": "0",
3118
"recurringFee": "0",
3219
"item": {
33-
"capacity": "25",
3420
"description": "25 GB (SAN)",
3521
"id": 1178,
3622
"keyName": "GUEST_DISK_25_GB_SAN",
37-
"units": "GB",
38-
"itemCategory": {
39-
"categoryCode": "guest_disk0",
40-
"id": 81,
41-
"name": "First Disk",
42-
}
4323
}
4424
},
4525
{
4626
"hourlyRecurringFee": ".342",
4727
"id": 207361,
48-
"itemId": 10939,
49-
"laborFee": "0",
5028
"recurringFee": "224.69",
5129
"item": {
52-
"capacity": "60",
5330
"description": "60 GB",
5431
"id": 10939,
5532
"keyName": "RAM_0_UNIT_PLACEHOLDER_10",
56-
"itemCategory": {
57-
"categoryCode": "ram",
58-
"id": 3,
59-
"name": "RAM",
60-
}
6133
}
6234
},
6335
{
6436
"hourlyRecurringFee": ".181",
6537
"id": 209595,
66-
"itemId": 11307,
67-
"laborFee": "0",
6838
"recurringFee": "118.26",
6939
"item": {
70-
"capacity": "8",
7140
"description": "8 x 2.0 GHz or higher Cores",
7241
"id": 11307,
73-
"itemTaxCategoryId": 166,
7442
"keyName": "GUEST_CORE_8",
75-
"itemCategory": {
76-
"categoryCode": "guest_core",
77-
"id": 80,
78-
"name": "Computing Instance",
79-
},
80-
"totalPhysicalCoreCount": 8
8143
}
8244
}
8345
]

tests/managers/ordering_tests.py

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,57 @@ def test_get_package_id_by_type_returns_valid_id(self):
6868

6969
self.assertEqual(46, package_id)
7070

71+
def test_get_preset_prices(self):
72+
preset_id = 405
73+
preset_prices = self.ordering.get_preset_prices(preset_id)
74+
75+
self.assertEqual(preset_prices, {
76+
"id": 405,
77+
"keyName": "AC1_8X60X25",
78+
"prices": [
79+
{
80+
"hourlyRecurringFee": "1.425",
81+
"id": 207345,
82+
"recurringFee": "936.23",
83+
"item": {
84+
"description": "1 x P100 GPU",
85+
"id": 10933,
86+
"keyName": "1_X_P100_GPU",
87+
}
88+
},
89+
{
90+
"hourlyRecurringFee": "0",
91+
"id": 2202,
92+
"recurringFee": "0",
93+
"item": {
94+
"description": "25 GB (SAN)",
95+
"id": 1178,
96+
"keyName": "GUEST_DISK_25_GB_SAN",
97+
}
98+
},
99+
{
100+
"hourlyRecurringFee": ".342",
101+
"id": 207361,
102+
"recurringFee": "224.69",
103+
"item": {
104+
"description": "60 GB",
105+
"id": 10939,
106+
"keyName": "RAM_0_UNIT_PLACEHOLDER_10",
107+
}
108+
},
109+
{
110+
"hourlyRecurringFee": ".181",
111+
"id": 209595,
112+
"recurringFee": "118.26",
113+
"item": {
114+
"description": "8 x 2.0 GHz or higher Cores",
115+
"id": 11307,
116+
"keyName": "GUEST_CORE_8",
117+
}
118+
}
119+
]
120+
})
121+
71122
def test_get_package_id_by_type_fails_for_nonexistent_package_type(self):
72123
p_mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
73124
p_mock.return_value = []

0 commit comments

Comments
 (0)