Exemplo n.º 1
0
 def test_get_domain_workgroup(self):
     """
     Test get_domain_workgroup
     """
     with patch.object(wmi, "WMI", Mock(return_value=self.WMI)), patch(
             "salt.utils.winapi.Com", MagicMock()), patch.object(
                 self.WMI,
                 "Win32_ComputerSystem",
                 return_value=[MockWMI_ComputerSystem()]):
         self.assertDictEqual(win_system.get_domain_workgroup(),
                              {"Workgroup": "WORKGROUP"})
Exemplo n.º 2
0
 def test_get_domain_workgroup(self):
     '''
     Test get_domain_workgroup
     '''
     with patch('salt.utils', Mockwinapi), \
             patch.object(wmi, 'WMI', Mock(return_value=self.WMI)), \
             patch('salt.utils.winapi.Com', MagicMock()), \
             patch.object(self.WMI, 'Win32_ComputerSystem',
                          return_value=[MockWMI_ComputerSystem()]):
         self.assertDictEqual(win_system.get_domain_workgroup(),
                              {'Workgroup': 'WORKGROUP'})