|
| 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