Exemplo n.º 1
0
    def test_multipath_flush(self):
        '''
        Test for Device-Mapper Multipath flush
        '''
        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'])
Exemplo n.º 2
0
    def test_multipath_flush(self):
        '''
        Test for Device-Mapper Multipath flush
        '''
        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'])
Exemplo n.º 3
0
    def test_multipath_flush(self):
        """
        Test for Device-Mapper Multipath flush
        """
        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"])