diff --git a/dist/pythonlibs/riotctrl_shell/cord_ep.py b/dist/pythonlibs/riotctrl_shell/cord_ep.py index bde762610f4a..0e2137006513 100644 --- a/dist/pythonlibs/riotctrl_shell/cord_ep.py +++ b/dist/pythonlibs/riotctrl_shell/cord_ep.py @@ -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_) diff --git a/dist/pythonlibs/riotctrl_shell/tests/test_cord_ep.py b/dist/pythonlibs/riotctrl_shell/tests/test_cord_ep.py index ea2bb5fa9e00..f567568f39c4 100644 --- a/dist/pythonlibs/riotctrl_shell/tests/test_cord_ep.py +++ b/dist/pythonlibs/riotctrl_shell/tests/test_cord_ep.py @@ -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 @@ -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"