From: Thanh Ha Date: Mon, 16 Mar 2015 04:41:55 +0000 (-0400) Subject: Fix pep8 violations in testmodule.py X-Git-Tag: release/helium-sr3~7^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=dd721d0d5ffd55ab9131a580a05db4103e9f28d3;p=integration%2Ftest.git Fix pep8 violations in testmodule.py Change-Id: I0d0ba32188cc81d6a34a85d1353bcb3b619efef0 Signed-off-by: Thanh Ha --- diff --git a/test/tools/CSIT_Test/base/testmodule.py b/test/tools/CSIT_Test/base/testmodule.py index 928b67b0bf..6ac3478451 100644 --- a/test/tools/CSIT_Test/base/testmodule.py +++ b/test/tools/CSIT_Test/base/testmodule.py @@ -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)