mirror of
https://github.com/espressif/openthread.git
synced 2026-08-08 19:57:46 +00:00
[python] remove unnecessary calls to dict.keys() (#4576)
This commit is contained in:
@@ -67,9 +67,9 @@ class Node:
|
||||
|
||||
def __init_sim(self, nodeid, mode):
|
||||
""" Initialize a simulation node. """
|
||||
if 'OT_CLI_PATH' in os.environ.keys():
|
||||
if 'OT_CLI_PATH' in os.environ:
|
||||
cmd = os.environ['OT_CLI_PATH']
|
||||
elif 'top_builddir' in os.environ.keys():
|
||||
elif 'top_builddir' in os.environ:
|
||||
srcdir = os.environ['top_builddir']
|
||||
cmd = '%s/examples/apps/cli/ot-cli-%s' % (srcdir, mode)
|
||||
else:
|
||||
@@ -102,12 +102,12 @@ class Node:
|
||||
else:
|
||||
args = ''
|
||||
|
||||
if 'OT_NCP_PATH' in os.environ.keys():
|
||||
if 'OT_NCP_PATH' in os.environ:
|
||||
cmd = 'spinel-cli.py -p "%s%s" -n' % (
|
||||
os.environ['OT_NCP_PATH'],
|
||||
args,
|
||||
)
|
||||
elif "top_builddir" in os.environ.keys():
|
||||
elif "top_builddir" in os.environ:
|
||||
builddir = os.environ['top_builddir']
|
||||
cmd = 'spinel-cli.py -p "%s/examples/apps/ncp/ot-ncp-%s%s" -n' % (
|
||||
builddir,
|
||||
|
||||
@@ -93,7 +93,7 @@ class TestRouteTable(unittest.TestCase):
|
||||
|
||||
for _node in self.nodes.values():
|
||||
router_table = _node.router_table()
|
||||
self.assertEqual(set(router_table.keys()), router_ids)
|
||||
self.assertEqual(set(router_table), router_ids)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
@@ -285,7 +285,7 @@ def discover(
|
||||
continue
|
||||
|
||||
# skip cases
|
||||
if case_name in log.keys():
|
||||
if case_name in log:
|
||||
if ((log[case_name]['passed'] and ('p' in skip)) or
|
||||
(log[case_name]['passed'] is False and ('f' in skip)) or
|
||||
(log[case_name]['passed'] is None and ('e' in skip))):
|
||||
|
||||
Reference in New Issue
Block a user