Fix pep8 violations in clustering-functional-test/settings 76/16576/1
authorThanh Ha <thanh.ha@linuxfoundation.org>
Mon, 16 Mar 2015 02:21:24 +0000 (22:21 -0400)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Mon, 16 Mar 2015 02:21:24 +0000 (22:21 -0400)
Change-Id: I7aa7e2d593584d392db38282af715242f1598c46
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
test/tools/odl-mdsal-clustering-tests/clustering-functional-test/settings.py

index 704b67155a590516b92515ee26fe18c63ab52395..c7d9bf8d99c3df978ad8003cb2e8ea2f3ab784c1 100644 (file)
@@ -9,102 +9,120 @@ from string import Template
 global hostname
 global port
 
+
 def getServer():
-    return hostname+":"+port
+    return hostname + ":" + port  # noqa
+
 
-#Cars resource URL for GET
 def getCarsUrl():
+    """Cars resource URL for GET"""
+    return "http://" + getServer() + "/restconf/config/car:cars"
 
-    return "http://"+getServer()+"/restconf/config/car:cars"
 
-#People resouce URL for GET
 def getPersonsUrl():
+    """People resouce URL for GET"""
+    return "http://" + getServer() + "/restconf/config/people:people"
 
-    return "http://"+getServer()+"/restconf/config/people:people"
 
-#GET cars persons mapping resource URL
 def getCarPersonUrl():
+    """GET cars persons mapping resource URL"""
+    return "http://" + getServer() + "/restconf/config/car-people:car-people"
 
-    return "http://"+getServer()+"/restconf/config/car-people:car-people"
 
-#POST or DELETE URL
 def getAddCarUrl():
-    return "http://"+getServer()+"/restconf/config"
-#POST or DELETE URL
+    """POST or DELETE URL"""
+    return "http://" + getServer() + "/restconf/config"
+
+
 def getAddPersonUrl():
-    return "http://"+getServer()+"/restconf/config"
+    """POST or DELETE URL"""
+    return "http://" + getServer() + "/restconf/config"
+
 
-#POST URL -using rpc
 def getAddPersonRpcUrl():
-    return "http://"+getServer()+"/restconf/operations/people:add-person"
+    """POST URL -using rpc"""
+    return "http://" + getServer() + "/restconf/operations/people:add-person"
+
 
-#POST URL for car person mapping
 def getAddCarPersonUrl():
-   return "http://"+getServer()+"/restconf/config"
-#POST URL for buy car rpc
+    """POST URL for car person mapping"""
+    return "http://" + getServer() + "/restconf/config"
+
+
 def getBuyCarRpcUrl():
-    return "http://"+getServer()+"/restconf/operations/car-purchase:buy-car"
+    """POST URL for buy car rpc"""
+    return "http://" + getServer() + "/restconf/operations/car-purchase:buy-car"
 
 
 # Template for Car resource payload
-add_car_payload_template = Template( '{\"car:cars\":{'
-    '\"car-entry\": ['
-        '{'
-            '\"id\": \"$id\",'
-            '\"category\": \"$category\",'
-            '\"model\": \"$model\",'
-            '\"manufacturer\": \"$manufacturer\",'
-            '\"year\": \"$year\"'
-        '}'
-    ']'
-'}'
-'}')
+add_car_payload_template = Template(
+    """
+    {"car:cars":{
+        "car-entry": [
+            {
+                "id": "$id",
+                "category": "$category",
+                "model": "$model",
+                "manufacturer": "$manufacturer",
+                "year": "$year"
+            }
+        ]
+    }}
+    """)
 
 # Template for Person resource payload
-add_person_payload_template =  Template( '{\"people:people":{'
-    '\"person\": ['
-        '{'
-            '\"id\": \"$personId\",'
-            '\"gender\": \"$gender\",'
-            '\"age\": \"$age\",'
-            '\"address\": \"$address\",'
-            '\"contactNo\":\"$contactNo\"'
-        '}'
-            ']'
-     '}}')
+add_person_payload_template = Template(
+    """
+    {"people:people":{
+        "person": [
+            {
+                "id": "$personId",
+                "gender": "$gender",
+                "age": "$age",
+                "address": "$address",
+                "contactNo":"$contactNo"
+            }
+        ]
+    }}
+    """)
 
 # Template for Car Person mapping  payload
-add_car_person_template = Template('{\"car-people:car-people\":{'
-    '\"car-person\": ['
-        '{'
-           ' \"car-id\": \"$Id\",'
-            '\"person-id\": \"$personId\"'
-        '}'
-    ']'
-'}'
-'}')
+add_car_person_template = Template(
+    """
+    {"car-people:car-people":{
+        "car-person": [
+            {
+                "car-id": "$Id",
+                "person-id": "$personId"
+            }
+        ]
+    }}
+    """)
 
 # Template for adding person using RPC
-add_person_rpc_payload_template = Template ( '{'
-                                                 '\"input\":'
-                                                     '{'
-                                                         '\"people:id\" : \"$personId\",'
-                                                         '\"people:gender\":\"$gender\",'
-                                                         '\"people:address\" : \"$address\",'
-                                                         '\"people:contactNo\":\"$contactNo\",'
-                                                         '\"people:age\":\"$age\"'
-                                                     '}'
-                                             '}')
-
-# Template for buing car rpc
-buy_car_rpc_template = Template ( '{'
-    '\"input\" :'
-        '{'
-            '\"car-purchase:person\" : \"/people:people/people:person[people:id=\'$personId\']\",'
-            '\"car-purchase:person-id\" : \"$personId\",'
-            '\"car-purchase:car-id\" : \"$carId\"'
-        '}'
-'}')
-
-
-
+add_person_rpc_payload_template = Template(
+    """
+    {
+    "input":
+        {
+            "people:id" : "$personId",
+            "people:gender":"$gender",
+            "people:address" : "$address",
+            "people:contactNo":"$contactNo",
+            "people:age":"$age"
+        }
+    }
+    """)
+
+# Template for buying car rpc
+buy_car_rpc_template = Template(
+    """
+    {
+    "input" :
+        {
+            "car-purchase:person" : "/people:people/people:person[people:id='$personId']",
+            "car-purchase:person-id" : "$personId",
+            "car-purchase:car-id" : "$carId"
+        }
+    }
+    """)