コード例 #1
0
 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'))
コード例 #2
0
ファイル: mac_desktop_test.py プロジェクト: bryson/salt
 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'))
コード例 #3
0
ファイル: test_mac_desktop.py プロジェクト: xeacott/salt
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")