def test_rm_fstab(self): ''' Remove the mount point from the fstab ''' mock_fstab = MagicMock(return_value={}) with patch.dict(mount.__grains__, {'kernel': ''}): with patch.object(mount, 'fstab', mock_fstab): with patch('salt.utils.files.fopen', mock_open()): self.assertTrue(mount.rm_fstab('name', 'device'))
def test_rm_fstab(): """ Remove the mount point from the fstab """ mock_fstab = MagicMock(return_value={}) with patch.dict(mount.__grains__, {"kernel": ""}): with patch.object(mount, "fstab", mock_fstab): with patch("salt.utils.files.fopen", mock_open()): assert mount.rm_fstab("name", "device")
def test_rm_fstab(self): """ Remove the mount point from the fstab """ mock_fstab = MagicMock(return_value={}) with patch.dict(mount.__grains__, {"kernel": ""}): with patch.object(mount, "fstab", mock_fstab): with patch("salt.utils.fopen", mock_open()): self.assertTrue(mount.rm_fstab("name", "device"))
def test_rm_fstab(self): """ Remove the mount point from the fstab """ mock = MagicMock(return_value={}) with patch.object(mount, "fstab", mock): self.assertTrue(mount.rm_fstab("name", "device")) mock = MagicMock(return_value={"name": "name"}) with patch.object(mount, "fstab", mock): with patch("salt.utils.fopen", mock_open()) as m_open: helper_open = m_open() helper_open.write.assertRaises(CommandExecutionError, mount.rm_fstab, config=None)
def test_rm_fstab(self): ''' Remove the mount point from the fstab ''' mock = MagicMock(return_value={}) with patch.object(mount, 'fstab', mock): self.assertTrue(mount.rm_fstab('name', 'device')) mock = MagicMock(return_value={'name': 'name'}) with patch.object(mount, 'fstab', mock): with patch('salt.utils.fopen', mock_open()) as m_open: helper_open = m_open() helper_open.write.assertRaises(CommandExecutionError, mount.rm_fstab, config=None)
def test_rm_fstab(self): ''' Remove the mount point from the fstab ''' mock_fstab = MagicMock(return_value={}) with patch.object(mount, 'fstab', mock_fstab): with patch('salt.utils.fopen', mock_open()): self.assertTrue(mount.rm_fstab('name', 'device')) mock_fstab = MagicMock(return_value={'name': 'name'}) with patch.object(mount, 'fstab', mock_fstab): with patch('salt.utils.fopen', mock_open()) as m_open: m_open.side_effect = IOError(13, 'Permission denied:', '/file') self.assertRaises(CommandExecutionError, mount.rm_fstab, 'name', 'device')