1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

riotctrl_shell: simplify error case for cord registration info parser

This commit is contained in:
Martine S. Lenders 2020-08-06 17:02:32 +02:00
parent b2c8270a40
commit 382cfee1de
No known key found for this signature in database
GPG Key ID: CCD317364F63286F
2 changed files with 3 additions and 3 deletions

View File

@ -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):

View File

@ -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(