def test_set_output_volume(self): ''' Test if it set the volume of sound (range 0 to 100) ''' mock = MagicMock(return_value={'retcode': 0}) with patch.dict(mac_desktop.__salt__, {'cmd.run_all': mock}): self.assertTrue(mac_desktop.set_output_volume('25'))
def test_set_output_volume(): """ Test if it set the volume of sound (range 0 to 100) """ mock = MagicMock(return_value={"retcode": 0}) with patch.dict(mac_desktop.__salt__, {"cmd.run_all": mock}), patch( "salt.modules.mac_desktop.get_output_volume", MagicMock(return_value="25")): assert mac_desktop.set_output_volume("25")