Change-Id: If16b9fb9ebd27f7f457dec2569998fd7012108e5
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
+from restlib import * # noqa
class TestModule(object):
class TestModule(object):
self.contentType = contentType
self.prefix = prefix
self.contentType = contentType
self.prefix = prefix
def extract_properties(self, content, key, property):
"""
Return all nodes.
"""
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]]
return None
else:
return [e.get(property) for e in content[key]]
def test_add_remove_operations(self, suffix_entries, suffix_entry, name, body, key):
result = []
def test_add_remove_operations(self, suffix_entries, suffix_entry, name, body, key):
result = []
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)
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)
if result == [True]:
self.remove_entry(suffix_entry, name)
r = self.get_entries(suffix_entries, key)