def test_lvresize(self): ''' Test to return information about the logical volume(s) ''' mock = MagicMock(return_value={'retcode': 1}) with patch.dict(linux_lvm.__salt__, {'cmd.run_all': mock}): self.assertDictEqual(linux_lvm.lvresize(1, 'a'), {}) mock = MagicMock(return_value={'retcode': 0}) with patch.dict(linux_lvm.__salt__, {'cmd.run_all': mock}): self.assertDictEqual(linux_lvm.lvresize(1, 'a'), {})
def test_lvresize(self): ''' Test to return information about the logical volume(s) ''' self.assertEqual(linux_lvm.lvresize(1, None, 1), {}) self.assertEqual(linux_lvm.lvresize(None, None, None), {}) mock = MagicMock(return_value='A') with patch.dict(linux_lvm.__salt__, {'cmd.run': mock}): self.assertDictEqual(linux_lvm.lvresize('A', 1), {'Output from lvresize': 'A'})
def test_lvresize(self): """ Test to return information about the logical volume(s) """ self.assertEqual(linux_lvm.lvresize(1, None, 1), {}) self.assertEqual(linux_lvm.lvresize(None, None, None), {}) mock = MagicMock(return_value="A") with patch.dict(linux_lvm.__salt__, {"cmd.run": mock}): self.assertDictEqual( linux_lvm.lvresize("A", 1), {"Output from lvresize": "A"} )
def test_lvresize(self): """ Tests to resize an LVM logical volume """ self.assertEqual(linux_lvm.lvresize(1, None, 1), {}) self.assertEqual(linux_lvm.lvresize(None, None, None), {}) mock = MagicMock(return_value={"retcode": 0, "stderr": ""}) with patch.dict(linux_lvm.__salt__, {"cmd.run_all": mock}): self.assertDictEqual( linux_lvm.lvresize(12, "/dev/fakevg/fakelv"), { "Output from lvresize": 'Logical volume "/dev/fakevg/fakelv" successfully resized.' }, )