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())
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")