def test_guess_server_host_returns_hostname_as_last_ditch_guess(self): def return_empty_list(*args): return [] self.patch(address, "get_command_output", return_empty_list) self.assertEqual(gethostname(), address.guess_server_host())
def test_guess_server_host_finds_IP_address(self): self.assertThat( address.guess_server_host(), MatchesRegex(r"^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$"), )