def test_multipath_flush(self):
        mock = MagicMock(return_value=False)
        with patch.object(os.path, 'exists', mock):
            self.assertEqual(devmap.multipath_flush('device'),
                             'device does not exist')

        mock = MagicMock(return_value=True)
        with patch.object(os.path, 'exists', mock):
            mock = MagicMock(return_value='A')
            with patch.dict(devmap.__salt__, {'cmd.run': mock}):
                self.assertEqual(devmap.multipath_flush('device'), ['A'])
Test for Device-Mapper Multipath flush
dataset/ETHPy150Open saltstack/salt/tests/unit/modules/devmap_test.py/DevMapTestCase.test_multipath_flush