Skip to content

Commit 5925e61

Browse files
very basic slcli vlan detail tests to make coverage happy
1 parent 1cc572b commit 5925e61

File tree

2 files changed

+58
-1
lines changed

2 files changed

+58
-1
lines changed
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
1-
getObject = {'primaryRouter': {'datacenter': {'id': 1234}}}
1+
getObject = {
2+
'primaryRouter': {
3+
'datacenter': {'id': 1234, 'longName': 'TestDC'},
4+
'fullyQualifiedDomainName': 'fcr01.TestDC'
5+
},
6+
'id': 1234,
7+
'vlanNumber': 4444,
8+
'firewallInterfaces': None
9+
}

tests/CLI/modules/vlan_tests.py

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
"""
2+
SoftLayer.tests.CLI.modules.vlan_tests
3+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4+
5+
:license: MIT, see LICENSE for more details.
6+
"""
7+
from SoftLayer import testing
8+
9+
10+
class VlanTests(testing.TestCase):
11+
12+
def test_detail(self):
13+
result = self.run_command(['vlan', 'detail', '1234'])
14+
self.assert_no_fail(result)
15+
16+
def test_detail_no_vs(self):
17+
result = self.run_command(['vlan', 'detail', '1234', '--no-vs'])
18+
self.assert_no_fail(result)
19+
20+
def test_detail_no_hardware(self):
21+
result = self.run_command(['vlan', 'detail', '1234', '--no-hardware'])
22+
self.assert_no_fail(result)
23+
24+
def test_subnet_list(self):
25+
vlan_mock = self.set_mock('SoftLayer_Network_Vlan', 'getObject')
26+
getObject = {
27+
'primaryRouter': {
28+
'datacenter': {'id': 1234, 'longName': 'TestDC'},
29+
'fullyQualifiedDomainName': 'fcr01.TestDC'
30+
},
31+
'id': 1234,
32+
'vlanNumber': 4444,
33+
'firewallInterfaces': None,
34+
'subnets': [
35+
{
36+
'id': 99,
37+
'networkIdentifier': 1111111,
38+
'netmask': '255.255.255.0',
39+
'gateway': '12.12.12.12',
40+
'subnetType': 'TEST',
41+
'usableIpAddressCount': 1
42+
43+
}
44+
45+
]
46+
}
47+
vlan_mock.return_value = getObject
48+
result = self.run_command(['vlan', 'detail', '1234'])
49+
self.assert_no_fail(result)

0 commit comments

Comments
 (0)