From 382cfee1de7e9168c3a31911116f25c8f37be6ad Mon Sep 17 00:00:00 2001 From: "Martine S. Lenders" Date: Thu, 6 Aug 2020 17:02:32 +0200 Subject: [PATCH] riotctrl_shell: simplify error case for cord registration info parser --- dist/pythonlibs/riotctrl_shell/cord_ep.py | 2 +- dist/pythonlibs/riotctrl_shell/tests/test_cord_ep.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/pythonlibs/riotctrl_shell/cord_ep.py b/dist/pythonlibs/riotctrl_shell/cord_ep.py index 77b1a74765..ecef80ca15 100644 --- a/dist/pythonlibs/riotctrl_shell/cord_ep.py +++ b/dist/pythonlibs/riotctrl_shell/cord_ep.py @@ -69,7 +69,7 @@ class CordEpRegistrationInfoParser(ShellInteractionParser): res[key] = int(m.group(key)) except ValueError: res[key] = m.group(key) - return res if bool(res) else None + return res class CordEpDiscoverParser(ShellInteractionParser): diff --git a/dist/pythonlibs/riotctrl_shell/tests/test_cord_ep.py b/dist/pythonlibs/riotctrl_shell/tests/test_cord_ep.py index 333ba8e232..ea2bb5fa9e 100644 --- a/dist/pythonlibs/riotctrl_shell/tests/test_cord_ep.py +++ b/dist/pythonlibs/riotctrl_shell/tests/test_cord_ep.py @@ -49,9 +49,9 @@ RD address: {proto}://[fe80::4494:71ff:fec4:9cac]{port} def test_cord_ep_parser_empty(): reginfo_parser = riotctrl_shell.cord_ep.CordEpRegistrationInfoParser() - assert reginfo_parser.parse("") is None + assert not reginfo_parser.parse("") discover_parser = riotctrl_shell.cord_ep.CordEpDiscoverParser() - assert discover_parser.parse("") is None + assert not discover_parser.parse("") @pytest.mark.parametrize(