コード例 #1
0
ファイル: test_drac.py プロジェクト: crimv42/saltstack
    def test_email_alerts(self):
        '''
        Test to Enable/Disable email alerts
        '''
        mock = MagicMock(return_value=True)
        with patch.object(drac, '__execute_cmd', mock):
            self.assertTrue(drac.email_alerts(True))

        mock = MagicMock(return_value=True)
        with patch.object(drac, '__execute_cmd', mock):
            self.assertTrue(drac.email_alerts(False))
コード例 #2
0
ファイル: drac_test.py プロジェクト: DaveQB/salt
    def test_email_alerts(self):
        '''
        Test to Enable/Disable email alerts
        '''
        mock = MagicMock(return_value=True)
        with patch.object(drac, '__execute_cmd', mock):
            self.assertTrue(drac.email_alerts(True))

        mock = MagicMock(return_value=True)
        with patch.object(drac, '__execute_cmd', mock):
            self.assertTrue(drac.email_alerts(False))