Пример #1
0
    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())
Пример #2
0
 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]+$"),
     )