File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,28 @@ def test_riotctrl_curdir():
52
52
os .environ .update (_environ )
53
53
54
54
55
+ def test_riotctrl_flash (monkeypatch ):
56
+ """Test the flash method of a riotctrl."""
57
+ args = []
58
+ kwargs = []
59
+
60
+ def make_run_mock (self , * _args , ** _kwargs ):
61
+ """
62
+ Mocks RIOTCtrl's make_run method
63
+ """
64
+ # pylint: disable=unused-argument
65
+ args .append (_args )
66
+ kwargs .append (_kwargs )
67
+
68
+ monkeypatch .setattr (riotctrl .ctrl .RIOTCtrl , 'make_run' , make_run_mock )
69
+ ctrl = riotctrl .ctrl .RIOTCtrl (APPLICATIONS_DIR )
70
+ ctrl .flash ()
71
+ assert len (args ) == len (kwargs ) == 1
72
+ assert args [- 1 ] == (riotctrl .ctrl .RIOTCtrl .FLASH_TARGETS ,)
73
+ assert kwargs [- 1 ] == {'stderr' : riotctrl .ctrl .DEVNULL ,
74
+ 'stdout' : riotctrl .ctrl .DEVNULL }
75
+
76
+
55
77
@pytest .fixture (name = 'app_pidfile_env' )
56
78
def fixture_app_pidfile_env ():
57
79
"""Environment to use application pidfile"""
You can’t perform that action at this time.
0 commit comments