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

Method test_flush_windows

testUpdateHostsFile.py:1440–1456  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1438 self.assertIn(expected, output)
1439
1440 def test_flush_windows(self):
1441 with self.mock_property("platform.system") as obj:
1442 obj.return_value = "win32"
1443
1444 with self.mock_property("os.name"):
1445 os.name = "nt"
1446 flush_dns_cache()
1447
1448 expected = (
1449 "Automatically flushing the DNS cache is "
1450 "not yet supported.\nPlease copy and paste "
1451 "the command 'ipconfig /flushdns' in "
1452 "administrator command prompt after running "
1453 "this script."
1454 )
1455 output = sys.stdout.getvalue()
1456 self.assertIn(expected, output)
1457
1458 @mock.patch("os.path.isfile", return_value=False)
1459 def test_flush_no_tool(self, _):

Callers

nothing calls this directly

Calls 2

flush_dns_cacheFunction · 0.90
mock_propertyMethod · 0.80

Tested by

no test coverage detected