MCPcopy
hub / github.com/StevenBlack/hosts / test_with_idna

Method test_with_idna

testUpdateHostsFile.py:1730–1740  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1728 self.assertEqual(expected, actual)
1729
1730 def test_with_idna(self):
1731 raw_resp_content = b"www.huala\xc3\xb1e.cl"
1732 resp_obj = requests.Response()
1733 resp_obj.__setstate__({"_content": raw_resp_content})
1734
1735 expected = "www.xn--hualae-0wa.cl"
1736
1737 with mock.patch("requests.get", return_value=resp_obj):
1738 actual = get_file_by_url("www.test-url.com")
1739
1740 self.assertEqual(expected, actual)
1741
1742 def test_connect_unknown_domain(self):
1743 test_url = (

Callers

nothing calls this directly

Calls 1

get_file_by_urlFunction · 0.90

Tested by

no test coverage detected