mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-26 23:11:19 +01:00
Merge pull request #18716 from miri64/riotctrl_shell/cleanup/rm-regif
riotctrl_shell.cord_ep: remove regif parameter
This commit is contained in:
commit
f30f9453f7
7
dist/pythonlibs/riotctrl_shell/cord_ep.py
vendored
7
dist/pythonlibs/riotctrl_shell/cord_ep.py
vendored
@ -117,11 +117,8 @@ class CordEp(ShellInteraction):
|
||||
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_)
|
||||
|
||||
@ -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"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user