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

Method test_flush_darwin

testUpdateHostsFile.py:1416–1428  ·  view source on GitHub ↗
(self, _)

Source from the content-addressed store, hash-verified

1414class TestFlushDnsCache(BaseStdout):
1415 @mock.patch("subprocess.call", return_value=0)
1416 def test_flush_darwin(self, _):
1417 with self.mock_property("platform.system") as obj:
1418 obj.return_value = "Darwin"
1419 flush_dns_cache()
1420
1421 expected = (
1422 "Flushing the DNS cache to utilize new hosts "
1423 "file...\nFlushing the DNS cache requires "
1424 "administrative privileges. You might need to "
1425 "enter your password."
1426 )
1427 output = sys.stdout.getvalue()
1428 self.assertIn(expected, output)
1429
1430 @mock.patch("subprocess.call", return_value=1)
1431 def test_flush_darwin_fail(self, _):

Callers

nothing calls this directly

Calls 2

flush_dns_cacheFunction · 0.90
mock_propertyMethod · 0.80

Tested by

no test coverage detected