Пример #1
0
 def test_get_computer_name_fail(self):
     """
     If it fails, it returns False
     """
     with patch("win32api.GetComputerNameEx", return_value=None):
         self.assertFalse(win_system.get_computer_name())
Пример #2
0
 def test_get_computer_name(self):
     """
     Should return the computer name
     """
     with patch("win32api.GetComputerNameEx", return_value="FAKENAME"):
         self.assertEqual(win_system.get_computer_name(), "FAKENAME")