Skip to content

Commit 2dae79a

Browse files
committed
Adding test coverage for mount_point_ready on Windows
1 parent 0013576 commit 2dae79a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/os_win7.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ def test_one_dev(self):
197197
self.setUpRegistry(value_dict, key_dict)
198198

199199
with patch('mbed_lstools.windows.MbedLsToolsWin7._run_cli_process') as _cliproc:
200+
_cliproc.return_value = ("", "", 0)
200201
expected_info = {
201202
'mount_point': u'F:',
202203
'serial_port': 'COM7',
@@ -207,5 +208,16 @@ def test_one_dev(self):
207208
self.assertIn(expected_info, devices)
208209
self.assertNoRegMut()
209210

211+
def test_mount_point_ready(self):
212+
with patch('mbed_lstools.windows.MbedLsToolsWin7._run_cli_process') as _cliproc:
213+
_cliproc.return_value = ("dummy", "", 0)
214+
self.assertTrue(self.lstool.mount_point_ready("dummy"))
215+
216+
_cliproc.reset_mock()
217+
218+
_cliproc.return_value = ("", "dummy", 1)
219+
self.assertFalse(self.lstool.mount_point_ready("dummy"))
220+
221+
210222
if __name__ == '__main__':
211223
unittest.main()

0 commit comments

Comments
 (0)