Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

riotctrl_shell.cord_ep: remove regif parameter #18716

Merged
merged 1 commit into from
Oct 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"