Skip to content

Commit

Permalink
riotctrl_shell.cord_ep: remove regif parameter
Browse files Browse the repository at this point in the history
The argument regif was removed from the shell command in RIOT-OS#18053,
so there is not much need to keep it in the ShellInteraction for that command.
  • Loading branch information
miri64 committed Oct 10, 2022
1 parent abf0883 commit 8c04964
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
7 changes: 2 additions & 5 deletions dist/pythonlibs/riotctrl_shell/cord_ep.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,8 @@ def cord_ep_cmd(self, cmd, args=None, timeout=-1, async_=False):
def cord_ep_info(self, timeout=-1, async_=False):
return self.cord_ep_cmd(self.INFO, None, timeout, async_)

def cord_ep_register(self, uri, regif=None, timeout=-1, async_=False):
args = [uri]
if regif is not None:
args.append(regif)
return self.cord_ep_cmd(self.REGISTER, args, timeout, async_)
def cord_ep_register(self, uri, timeout=-1, async_=False):
return self.cord_ep_cmd(self.REGISTER, (uri,), timeout, async_)

def cord_ep_discover(self, uri, timeout=-1, async_=False):
return self.cord_ep_cmd(self.DISCOVER, (uri,), timeout, async_)
Expand Down
18 changes: 9 additions & 9 deletions dist/pythonlibs/riotctrl_shell/tests/test_cord_ep.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,18 @@ def test_cord_ep_parser_empty():


@pytest.mark.parametrize(
"uri,regif,expected",
"uri,expected",
[
("[fe80::1]", None, "cord_ep register [fe80::1]"),
("[fe80::1%iface0]", None, "cord_ep register [fe80::1%iface0]"),
("[fe80::1]:5684", None, "cord_ep register [fe80::1]:5684"),
("[fe80::1]", "/regif", "cord_ep register [fe80::1] /regif"),
("coap://[fe80::1]", "cord_ep register coap://[fe80::1]"),
("coap://[fe80::1%iface0]", "cord_ep register coap://[fe80::1%iface0]"),
("coap://[fe80::1]:5684", "cord_ep register coap://[fe80::1]:5684"),
("coap://[fe80::1]/regif", "cord_ep register coap://[fe80::1]/regif"),
]
)
def test_cord_ep_register(uri, regif, expected):
def test_cord_ep_register(uri, expected):
rc = init_ctrl()
si = riotctrl_shell.cord_ep.CordEp(rc)
res = si.cord_ep_register(uri, regif)
res = si.cord_ep_register(uri)
assert res == expected


Expand Down Expand Up @@ -108,5 +108,5 @@ def test_cord_ep_error(error_msg):
rc = init_ctrl(error_msg)
si = riotctrl_shell.cord_ep.CordEp(rc)
with pytest.raises(RuntimeError):
si.cord_ep_register("[abcde]:1234", "lalala")
assert rc.term.last_command == "cord_ep register [abcde]:1234 lalala"
si.cord_ep_register("coap://[abcde]:1234")
assert rc.term.last_command == "cord_ep register coap://[abcde]:1234"

0 comments on commit 8c04964

Please sign in to comment.