Skip to content

Commit 768d14d

Browse files
committed
Added cli loadlal detail by address tests
1 parent e05c70c commit 768d14d

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

SoftLayer/fixtures/SoftLayer_Network_LBaaS_LoadBalancer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
getObject = {
22
'accountId': 1234,
3-
'address': '01-307608-ams01.clb.appdomain.cloud',
3+
'address': 'test-01-307608-ams01.clb.appdomain.cloud ',
44
'createDate': '2019-08-12T07:49:43-06:00',
55
'id': 1111111,
66
'isPublic': 0,

tests/CLI/modules/loadbal_tests.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import SoftLayer
99
from SoftLayer.CLI.exceptions import ArgumentError
10+
from SoftLayer.CLI.exceptions import CLIAbort
1011
from SoftLayer import exceptions
1112
from SoftLayer.fixtures import SoftLayer_Network_LBaaS_LoadBalancer
1213
from SoftLayer.fixtures import SoftLayer_Product_Package
@@ -216,6 +217,16 @@ def test_lb_detail(self):
216217
result = self.run_command(['lb', 'detail', '1111111'])
217218
self.assert_no_fail(result)
218219

220+
def test_lb_detail_by_address(self):
221+
address = SoftLayer_Network_LBaaS_LoadBalancer.getObject.get('address')
222+
result = self.run_command(['lb', 'detail', address])
223+
self.assert_no_fail(result)
224+
225+
def test_lb_detail_address_not_found(self):
226+
address = 'test-01-ams01.clb.appdomain.cloud'
227+
result = self.run_command(['lb', 'detail', address])
228+
self.assertIsInstance(result.exception, CLIAbort)
229+
219230
def test_order(self):
220231
result = self.run_command(['loadbal', 'order', '--name', 'test', '--datacenter', 'par01', '--label',
221232
'labeltest', '--subnet', '759282'])

0 commit comments

Comments
 (0)