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

Method test_flush_no_tool

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

Source from the content-addressed store, hash-verified

1457
1458 @mock.patch("os.path.isfile", return_value=False)
1459 def test_flush_no_tool(self, _):
1460 with self.mock_property("platform.system") as obj:
1461 obj.return_value = "Linux"
1462
1463 with self.mock_property("os.name"):
1464 os.name = "posix"
1465 flush_dns_cache()
1466
1467 expected = "Unable to determine DNS management tool."
1468 output = sys.stdout.getvalue()
1469 self.assertIn(expected, output)
1470
1471 @mock.patch("os.path.isfile", side_effect=[True] + [False] * 11)
1472 @mock.patch("subprocess.call", return_value=0)

Callers

nothing calls this directly

Calls 2

flush_dns_cacheFunction · 0.90
mock_propertyMethod · 0.80

Tested by

no test coverage detected