예제 #1
0
 def test_TraceQuery_targetClass_write(self):
     dnStr1 = 'uni'
     klass1 = 'topSystem'
     klass2 = 'polUni'
     tq = TraceQuery(dnStr1, klass1)
     tq.targetClass = klass2
     assert tq.targetClass == klass2
예제 #2
0
 def test_TraceQuery_targetClass_write(self):
     dnStr1 = 'uni'
     klass1 = 'topSystem'
     klass2 = 'polUni'
     tq = TraceQuery(dnStr1, klass1)
     tq.targetClass = klass2
     assert tq.targetClass == klass2
예제 #3
0
 def test_TraceQuery_options(self):
     tid = '1234567890'
     klass = 'fvTenant'
     tq = TraceQuery('uni', 'fvTenant')
     expectedOptions = 'target-class=' + klass
     tq.id = tid
     expectedOptions += '&_dc=' + tid
     assert tq.options == expectedOptions
예제 #4
0
 def test_TraceQuery_options(self):
     tid = '1234567890'
     klass = 'fvTenant'
     tq = TraceQuery('uni', 'fvTenant')
     expectedOptions = 'target-class=' + klass
     tq.id = tid
     expectedOptions += '&_dc=' + tid
     assert tq.options == expectedOptions
예제 #5
0
 def test_TraceQuery_getUrl(self, sessionUrl, dc, requestType):
     session = LoginSession(sessionUrl, 'admin', 'password',
                            requestFormat=requestType)
     dnStr = 'uni'
     klass = 'fvTenant'
     cq = TraceQuery(dnStr, klass)
     expected = sessionUrl + '/api/trace/' + dnStr + '.' + requestType
     expected += '?target-class=' + klass
     cq.id = dc
     expected += '&_dc=' + dc
     assert cq.getUrl(session) == expected
예제 #6
0
 def test_TraceQuery_getUrl(self, sessionUrl, dc, requestType):
     session = LoginSession(sessionUrl, 'admin', 'password',
                            requestFormat=requestType)
     dnStr = 'uni'
     klass = 'fvTenant'
     cq = TraceQuery(dnStr, klass)
     expected = sessionUrl + '/api/trace/' + dnStr + '.' + requestType
     expected += '?target-class=' + klass
     cq.id = dc
     expected += '&_dc=' + dc
     assert cq.getUrl(session) == expected
예제 #7
0
def getAncestorDnStrFromDnString(md, input, level):

    fvAEPg_dnStr = str(Dn.fromString(input).getAncestor(level))

    tq = TraceQuery(fvAEPg_dnStr, 'fvBD')
    tq.subtree = 'children'
    fvBD = md.query(tq)[0]

    bd = tDnToBdCtx(str(fvBD.dn), 'BD')
    ctx = tDnToBdCtx((fvBD.rsctx._childObjects[None].tDn), 'ctx')
    if bd and ctx: return bd, ctx
    else: return 'na', 'na'
예제 #8
0
def getAncestorDnStrFromDnString(md, input, level):

    fvAEPg_dnStr = str(Dn.fromString(input).getAncestor(level))

    tq = TraceQuery(fvAEPg_dnStr, 'fvBD')
    tq.subtree = 'children'
    fvBD = md.query(tq)[0]

    bd=tDnToBdCtx(str(fvBD.dn),'BD')
    ctx=tDnToBdCtx((fvBD.rsctx._childObjects[None].tDn),'ctx')
    if bd and ctx: return bd,ctx
    else: return 'na','na'
예제 #9
0
 def test_TraceQuery_dnStr_read(self):
     dnStr = 'uni'
     klass = 'topSystem'
     tq = TraceQuery(dnStr, klass)
     assert tq.dnStr == dnStr
예제 #10
0
 def test_TraceQuery_targetClass_read(self):
     dnStr = 'uni'
     klass = 'topSystem'
     tq = TraceQuery(dnStr, klass)
     assert tq.targetClass == klass
예제 #11
0
 def test_TraceQuery_init(self):
     assert isinstance(TraceQuery('fabric', 'fvTenant'), TraceQuery)