當前位置: 首頁>>代碼示例>>Python>>正文


Python SettingsLibrary.getAddCarUrl方法代碼示例

本文整理匯總了Python中SettingsLibrary.getAddCarUrl方法的典型用法代碼示例。如果您正苦於以下問題:Python SettingsLibrary.getAddCarUrl方法的具體用法?Python SettingsLibrary.getAddCarUrl怎麽用?Python SettingsLibrary.getAddCarUrl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SettingsLibrary的用法示例。


在下文中一共展示了SettingsLibrary.getAddCarUrl方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: addCar

# 需要導入模塊: import SettingsLibrary [as 別名]
# 或者: from SettingsLibrary import getAddCarUrl [as 別名]
def addCar(hostname,port,numberOfCars):

    for x in range(1, numberOfCars+1):
        strId = str(x)
        payload = SettingsLibrary.add_car_payload_template.substitute(id=strId,category="category"+strId,model="model"+strId,
                                                           manufacturer="manufacturer"+strId,
                                                           year=(2000+x%100))
        print("payload formed after template substitution=")
        print(payload)
        # Send the POST request
        resp = UtilLibrary.post(SettingsLibrary.getAddCarUrl(hostname,port),"admin", "admin",payload)

        print("the response of the POST to add car=")
        print(resp)

    return resp
開發者ID:Cygnus-Labs,項目名稱:opendaylight-integration,代碼行數:18,代碼來源:CrudLibrary.py

示例2: addCar

# 需要導入模塊: import SettingsLibrary [as 別名]
# 或者: from SettingsLibrary import getAddCarUrl [as 別名]
def addCar(hostname, port, numberOfCars):
    """Creates the specified number of cars based on Cars yang model using RESTCONF"""
    for x in range(1, numberOfCars+1):
        strId = str(x)
        payload = SettingsLibrary.add_car_payload_template.substitute(
            id=strId, category="category" + strId, model="model" + strId,
            manufacturer="manufacturer" + strId,
            year=(2000 + x % 100))
        print("payload formed after template substitution=")
        print(payload)
        # Send the POST request
        resp = UtilLibrary.post(SettingsLibrary.getAddCarUrl(hostname, port), "admin", "admin", payload)

        print("the response of the POST to add car=")
        print(resp)

    time.sleep(5)  # Let the add finish
    return resp
開發者ID:weiwangblog,項目名稱:integration,代碼行數:20,代碼來源:CrudLibrary.py

示例3: addCar

# 需要導入模塊: import SettingsLibrary [as 別名]
# 或者: from SettingsLibrary import getAddCarUrl [as 別名]
def addCar(hostname, port, numberOfCars, *expected):
    """Creates the specified number of cars based on Cars yang model using RESTCONF"""
    for x in range(1, numberOfCars + 1):
        strId = str(x)
        payload = SettingsLibrary.add_car_payload_template.substitute(
            id=strId, category="category" + strId, model="model" + strId,
            manufacturer="manufacturer" + strId,
            year=(2000 + x % 100))
        print("payload formed after template substitution=")
        print(payload)
        # Send the POST request
        resp = UtilLibrary.post(SettingsLibrary.getAddCarUrl(hostname, port), "admin", "admin", payload)

        print("the response of the POST to add car=")
        print(resp)
        if expected and str(resp.status_code) not in expected:
            raise RuntimeError('Add car failed for {}:{} with status {}'.
                               format(hostname, port, resp.status_code))

    return resp
開發者ID:ljakab,項目名稱:integration-test,代碼行數:22,代碼來源:CrudLibrary.py


注:本文中的SettingsLibrary.getAddCarUrl方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。