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

Method test_flush_darwin_fail

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

Source from the content-addressed store, hash-verified

1429
1430 @mock.patch("subprocess.call", return_value=1)
1431 def test_flush_darwin_fail(self, _):
1432 with self.mock_property("platform.system") as obj:
1433 obj.return_value = "Darwin"
1434 flush_dns_cache()
1435
1436 expected = "Flushing the DNS cache failed."
1437 output = sys.stdout.getvalue()
1438 self.assertIn(expected, output)
1439
1440 def test_flush_windows(self):
1441 with self.mock_property("platform.system") as obj:

Callers

nothing calls this directly

Calls 2

flush_dns_cacheFunction · 0.90
mock_propertyMethod · 0.80

Tested by

no test coverage detected