def test_rescan_all(self):
        mock = MagicMock(side_effect=[False, True])
        with patch.object(os.path, 'isdir', mock):
            self.assertEqual(scsi.rescan_all('host'),
                             'Host host does not exist')

            with patch.dict(scsi.__salt__,
                            {'cmd.run': MagicMock(return_value='A')}):
                self.assertListEqual(scsi.rescan_all('host'), ['A'])
Factory:  construct an entry given its API representation
dataset/ETHPy150Open saltstack/salt/tests/unit/modules/scsi_test.py/ScsiTestCase.test_rescan_all--crossover with--dataset/ETHPy150Open GoogleCloudPlatform/gcloud-python/gcloud/logging/entries.py/_BaseEntry.from_api_repr