Skip to content

Commit d6b6324

Browse files
committed
Mock mount point ready, remove list unmounted
1 parent 2e562f9 commit d6b6324

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

test/mbedls_toolsbase.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,10 @@ def test_fs_never(self):
248248
'serial_port': 'invalid_serial_port'
249249
}
250250
self.base.return_value = [device]
251-
self.base.list_unmounted = True
252-
with patch("mbed_lstools.lstools_base.MbedLsToolsBase._update_device_from_fs") as _up_fs:
251+
with patch("mbed_lstools.lstools_base.MbedLsToolsBase._update_device_from_fs") as _up_fs,\
252+
patch("mbed_lstools.lstools_base.MbedLsToolsBase.mount_point_ready") as mount_point_ready:
253+
mount_point_ready.return_value = True
254+
253255
filter = None
254256
ret = self.base.list_mbeds(FSInteraction.Never, filter, read_details_txt=False)
255257
ret_with_details = self.base.list_mbeds(FSInteraction.Never, filter, read_details_txt=True)
@@ -284,16 +286,18 @@ def test_fs_after(self):
284286
'mount_point': 'invalid_mount_point',
285287
'serial_port': 'invalid_serial_port'
286288
}
287-
self.base.list_unmounted = True
288289
with patch("mbed_lstools.lstools_base.MbedLsToolsBase._read_htm_ids") as _read_htm,\
289290
patch("mbed_lstools.lstools_base.MbedLsToolsBase._details_txt") as _up_details,\
291+
patch("mbed_lstools.lstools_base.MbedLsToolsBase.mount_point_ready") as mount_point_ready,\
290292
patch('os.listdir') as _listdir:
291293
new_device_id = "00017531642046"
292294
_read_htm.return_value = (new_device_id, {})
293295
_listdir.return_value = []
294296
_up_details.return_value = {
295297
'automation_allowed': '0'
296298
}
299+
mount_point_ready.return_value = True
300+
297301
filter = None
298302
self.base.return_value = [deepcopy(device)]
299303
ret = self.base.list_mbeds(FSInteraction.AfterFilter, filter, False, False)
@@ -351,16 +355,17 @@ def test_fs_before(self):
351355
'mount_point': 'invalid_mount_point',
352356
'serial_port': 'invalid_serial_port'
353357
}
354-
self.base.list_unmounted = True
355358
with patch("mbed_lstools.lstools_base.MbedLsToolsBase._read_htm_ids") as _read_htm,\
356359
patch("mbed_lstools.lstools_base.MbedLsToolsBase._details_txt") as _up_details,\
360+
patch("mbed_lstools.lstools_base.MbedLsToolsBase.mount_point_ready") as mount_point_ready,\
357361
patch('os.listdir') as _listdir:
358362
new_device_id = u'00017575430420'
359363
_read_htm.return_value = (new_device_id, {})
360364
_listdir.return_value = []
361365
_up_details.return_value = {
362366
'automation_allowed': '0'
363367
}
368+
mount_point_ready.return_value = True
364369

365370
filter = None
366371
self.base.return_value = [deepcopy(device)]

0 commit comments

Comments
 (0)