def test_get_output_volume(): """ Test if it get the output volume (range 0 to 100) """ mock = MagicMock(return_value={"retcode": 0, "stdout": "25"}) with patch.dict(mac_desktop.__salt__, {"cmd.run_all": mock}): assert mac_desktop.get_output_volume() == "25"
def test_get_output_volume(self): ''' Test if it get the output volume (range 0 to 100) ''' mock = MagicMock(return_value={'retcode': 0, 'stdout': '25'}) with patch.dict(mac_desktop.__salt__, {'cmd.run_all': mock}): self.assertEqual(mac_desktop.get_output_volume(), '25')
def test_get_output_volume(self): ''' Test if it get the output volume (range 0 to 100) ''' mock = MagicMock(return_value=True) with patch.dict(mac_desktop.__salt__, {'cmd.run': mock}): self.assertTrue(mac_desktop.get_output_volume())