def test_AliasRequest_options(self): aid = '1234567890' dnStr = 'system' aliasStr = 'alias1' ar = AliasRequest(dnStr, alias=aliasStr) expectedOptions = 'set=' + aliasStr ar.id = aid expectedOptions += '&_dc=' + aid assert ar.options == expectedOptions
def test_AliasRequest_getUrl(self, sessionUrl, dc, aliasStr, clear, requestType): dnStr = 'uni' session = LoginSession(sessionUrl, 'admin', 'password', requestFormat=requestType) ar = AliasRequest(dnStr) expectedUrl = sessionUrl + '/api/alias/mo/' + dnStr + '.' + requestType if clear: ar.alias = aliasStr ar.clear() expectedUrl += '?clear=yes' else: ar.alias = aliasStr expectedUrl += '?set=' + aliasStr ar.id = dc expectedUrl += '&_dc=' + dc assert ar.getUrl(session) == expectedUrl