def test_vgextend(self): ''' Tests add physical volumes to an LVM volume group ''' self.assertEqual(linux_lvm.vgextend('', ''), 'Error: vgname and device(s) are both required') mock = MagicMock(return_value='A\nB') with patch.dict(linux_lvm.__salt__, {'cmd.run': mock}): with patch.object(linux_lvm, 'vgdisplay', return_value={}): self.assertDictEqual(linux_lvm.vgextend('A', 'B'), {'Output from vgextend': 'A'})
def test_vgextend(self): ''' Tests add physical volumes to an LVM volume group ''' self.assertEqual(linux_lvm.vgextend('', ''), 'Error: vgname and device(s) are both required') mock = MagicMock(return_value='A\nB') with patch.dict(linux_lvm.__salt__, {'cmd.run': mock}): with patch.object(linux_lvm, 'vgdisplay', return_value={}): self.assertDictEqual(linux_lvm.vgextend('A', 'B'), {'Output from vgextend': 'A'})
def test_vgextend(self): """ Tests add physical volumes to an LVM volume group """ self.assertEqual( linux_lvm.vgextend("", ""), "Error: vgname and device(s) are both required" ) mock = MagicMock(return_value="A\nB") with patch.dict(linux_lvm.__salt__, {"cmd.run": mock}): with patch.object(linux_lvm, "vgdisplay", return_value={}): self.assertDictEqual( linux_lvm.vgextend("A", "B"), {"Output from vgextend": "A"} )
def test_vgextend(self): """ Tests add physical volumes to an LVM volume group """ self.assertEqual( linux_lvm.vgextend("", ""), "Error: vgname and device(s) are both required" ) mock = MagicMock(return_value={"retcode": 0, "stderr": ""}) with patch.dict(linux_lvm.__salt__, {"cmd.run_all": mock}): with patch.object(linux_lvm, "vgdisplay", return_value={}): self.assertDictEqual( linux_lvm.vgextend("fakevg", "B"), { "Output from vgextend": 'Volume group "fakevg" successfully extended' }, )