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

Method test_set_extensions

testUpdateHostsFile.py:1308–1332  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1306 self.assertEqual(actual, expected)
1307
1308 def test_set_extensions(self):
1309 with open(self.readme_file, "w") as f:
1310 json.dump({}, f)
1311
1312 kwargs = dict(
1313 extensions=["com", "org"],
1314 outputsubfolder="foo",
1315 numberofrules=5,
1316 sourcesdata="hosts",
1317 nounifiedhosts=False,
1318 )
1319 update_readme_data(self.readme_file, **kwargs)
1320
1321 if platform.system().lower() == "windows":
1322 sep = "/"
1323 else:
1324 sep = self.sep
1325
1326 expected = {
1327 "com-org": {"location": "foo" + sep, 'nounifiedhosts': False, "sourcesdata": "hosts", "entries": 5}
1328 }
1329
1330 with open(self.readme_file, "r") as f:
1331 actual = json.load(f)
1332 self.assertEqual(actual, expected)
1333
1334 def test_set_no_unified_hosts(self):
1335 with open(self.readme_file, "w") as f:

Callers

nothing calls this directly

Calls 1

update_readme_dataFunction · 0.90

Tested by

no test coverage detected