1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
import unittest
from ncclient import devices
class TestGetSupportedDevices(unittest.TestCase):
def test_get_supported_devices(self):
supported_devices = devices.get_supported_devices()
self.assertEqual(sorted(supported_devices), sorted(('junos',
'csr',
'ciena',
'nexus',
'iosxr',
'iosxe',
'huawei',
'huaweiyang',
'alu',
'h3c',
'hpcomware',
'sros',
'default')))
def test_get_supported_device_labels(self):
supported_device_labels = devices.get_supported_device_labels()
self.assertEqual(supported_device_labels, {'junos':'Juniper',
'csr':'Cisco CSR1000v',
'ciena': 'Ciena',
'nexus':'Cisco Nexus',
'iosxr':'Cisco IOS XR',
'iosxe':'Cisco IOS XE',
'huawei':'Huawei',
'huaweiyang':'Huawei',
'alu':'Alcatel Lucent',
'h3c':'H3C',
'hpcomware':'HP Comware',
'sros':'Nokia SR OS',
'default':'Server or anything not in above'})
|