Fix pep8 violations in testmodule
authorThanh Ha <thanh.ha@linuxfoundation.org>
Mon, 16 Mar 2015 03:49:11 +0000 (23:49 -0400)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Mon, 16 Mar 2015 03:49:11 +0000 (23:49 -0400)
Change-Id: If16b9fb9ebd27f7f457dec2569998fd7012108e5
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
test/tools/Robot_Tool/libraries/testmodule.py

index 928b67b0bfa2334a98975656134f8395a0cf33d8..6ac3478451422ed396edb2b6f7935700bcd21b6e 100644 (file)
@@ -4,7 +4,7 @@ Authors: Baohua Yang@IBM, Denghui Huang@IBM
 Updated: 2013-10-30
 """
 
-from restlib import *
+from restlib import *  # noqa
 
 
 class TestModule(object):
@@ -22,12 +22,11 @@ class TestModule(object):
         self.contentType = contentType
         self.prefix = prefix
 
-
     def extract_properties(self, content, key, property):
         """
         Return all nodes.
         """
-        if not isinstance(content, dict) or not content.has_key(key):
+        if not isinstance(content, dict) or key not in content:
             return None
         else:
             return [e.get(property) for e in content[key]]
@@ -63,13 +62,13 @@ class TestModule(object):
 
     def test_add_remove_operations(self, suffix_entries, suffix_entry, name, body, key):
         result = []
-        #Add an entry
+        # Add an entry
         self.add_entry(suffix_entry, name, body)
         r = self.get_entries(suffix_entries, key)
         if r:
             v = r.get(key)
             result.append(body in v if v else False)
-            #Remove the added entry
+            # Remove the added entry
         if result == [True]:
             self.remove_entry(suffix_entry, name)
             r = self.get_entries(suffix_entries, key)