def test_get_table(self): """ Test ConcretePortChannel create table function """ node1 = Node('103') node2 = Node('102') concretePortChannel1 = ConcretePortChannel(node1) concretePortChannel2 = ConcretePortChannel(node2) concretePortChannel1.attr['id'] = '1' concretePortChannel2.attr['id'] = '2' concretePortChannels = [concretePortChannel1, concretePortChannel2] self.assertTrue( isinstance( ConcretePortChannel.get_table(concretePortChannels)[0], Table))
def test_get_name_from_dn(self): """ Test that ConcretePortChannel._get_name_from_dn returns the name derived from the dn provided """ dn = 'topology/pod-1/node-101/sys/aggr-[po3]' self.assertEquals(ConcretePortChannel._get_name_from_dn(dn), '[po3]')
def test_get_parent_class(self): """ Ensure class has the correct parent class """ self.assertEquals(ConcretePortChannel._get_parent_class(), Node)