def test_get_name_from_dn(self): """ Test that ConcreteContext._get_name_from_dn returns the name derived from the dn provided """ dn = 'topology/pod-1/node-202/sys/ctx-[vxlan-2129920]' self.assertEquals( ConcreteContext._get_name_from_dn(dn), '[vxlan-2129920]')
def test_get_table(self): """ Test ConcreteContext create table function """ node1 = Node('103') node2 = Node('102') concreteContext1 = ConcreteContext(node1) concreteContext2 = ConcreteContext(node2) concreteContext1.attr['tenant'] = 'tenant1' concreteContext1.attr['context'] = 'context1' concreteContext2.attr['tenant'] = 'tenant2' concreteContext2.attr['context'] = 'context2' concreteContexts = [concreteContext1, concreteContext2] self.assertTrue( isinstance( ConcreteContext.get_table(concreteContexts)[0], Table))
def test_get_parent_class(self): """ Ensure class has the correct parent class """ self.assertEquals(ConcreteContext._get_parent_class(), Node)