1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-27 07:21:18 +01:00

riotctrl_shell.tests: add regression test for non-str ifconfig_set()

This commit is contained in:
Martine S. Lenders 2020-07-09 15:40:13 +02:00
parent 0a86086967
commit 6c2d8f7a14
No known key found for this signature in database
GPG Key ID: CCD317364F63286F

View File

@ -76,12 +76,18 @@ def test_ifconfig_help():
assert res == "ifconfig foobar help"
def test_ifconfig_set():
rc = init_ctrl(output="success: address set")
@pytest.mark.parametrize(
"option,value,expected",
[("addr", "42:de:ad:c0:ff:ee",
"ifconfig foobar set addr 42:de:ad:c0:ff:ee"),
("chan", 17, "ifconfig foobar set chan 17")]
)
def test_ifconfig_set(option, value, expected):
rc = init_ctrl(output="success: option set")
si = riotctrl_shell.netif.Ifconfig(rc)
res = si.ifconfig_set("foobar", "addr", "42:de:ad:c0:ff:ee")
assert res == "success: address set"
assert rc.term.last_command == "ifconfig foobar set addr 42:de:ad:c0:ff:ee"
res = si.ifconfig_set("foobar", option, value)
assert res == "success: option set"
assert rc.term.last_command == expected
def test_ifconfig_set_error():