コード例 #1
0
ファイル: test_win_snmp.py プロジェクト: cldeluna/salt
 def test_set_community_names(self):
     '''
     Test - Manage the SNMP accepted community names and their permissions.
     '''
     mock_value = MagicMock(return_value=True)
     kwargs = {'communities': COMMUNITY_NAMES}
     with patch.dict(win_snmp.__salt__, {'reg.set_value': mock_value}):
         self.assertTrue(win_snmp.set_community_names(**kwargs))
コード例 #2
0
ファイル: win_snmp_test.py プロジェクト: bryson/salt
 def test_set_community_names(self):
     '''
     Test - Manage the SNMP accepted community names and their permissions.
     '''
     mock_value = MagicMock(return_value=True)
     kwargs = {'communities': COMMUNITY_NAMES}
     with patch.dict(win_snmp.__salt__, {'reg.set_value': mock_value}):
         self.assertTrue(win_snmp.set_community_names(**kwargs))
コード例 #3
0
ファイル: test_win_snmp.py プロジェクト: morinap/salt-1
 def test_set_community_names(self):
     '''
     Test - Manage the SNMP accepted community names and their permissions.
     '''
     mock_true = MagicMock(return_value=True)
     kwargs = {'communities': COMMUNITY_NAMES}
     mock_false = MagicMock(return_value=False)
     with patch.dict(win_snmp.__utils__, {'reg.set_value': mock_true,
                                          'reg.key_exists': mock_false}), \
             patch('salt.modules.win_snmp.get_community_names',
                   MagicMock(return_value=COMMUNITY_NAMES)):
         self.assertTrue(win_snmp.set_community_names(**kwargs))
コード例 #4
0
 def test_set_community_names(self):
     """
     Test - Manage the SNMP accepted community names and their permissions.
     """
     mock_true = MagicMock(return_value=True)
     kwargs = {"communities": COMMUNITY_NAMES}
     mock_false = MagicMock(return_value=False)
     with patch.dict(
             win_snmp.__salt__,
         {
             "reg.set_value": mock_true,
             "reg.key_exists": mock_false
         },
     ), patch(
             "salt.modules.win_snmp.get_community_names",
             MagicMock(return_value=COMMUNITY_NAMES),
     ):
         self.assertTrue(win_snmp.set_community_names(**kwargs))