MCPcopy Index your code
hub / github.com/StevenBlack/hosts / test_extensions

Method test_extensions

testUpdateHostsFile.py:1126–1158  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1124 self.assertNotIn(expected, contents)
1125
1126 def test_extensions(self):
1127 kwargs = dict(
1128 extensions=["epsilon", "gamma", "mu", "phi"],
1129 outputsubfolder="",
1130 numberofrules=5,
1131 skipstatichosts=True,
1132 nounifiedhosts=False,
1133 )
1134 write_opening_header(self.final_file, **kwargs)
1135
1136 contents = self.final_file.getvalue()
1137 contents = contents.decode("UTF-8")
1138
1139 # Expected contents.
1140 for expected in (
1141 ", ".join(kwargs["extensions"]),
1142 "# Extensions added to this file:",
1143 "# This hosts file is a merged collection",
1144 "# with a dash of crowd sourcing via GitHub",
1145 "# Number of unique domains: {count}".format(count=kwargs["numberofrules"]),
1146 "Fetch the latest version of this file:",
1147 "Project home page: https://github.com/StevenBlack/hosts",
1148 ):
1149 self.assertIn(expected, contents)
1150
1151 # Expected non-contents.
1152 for expected in (
1153 "127.0.0.1 localhost",
1154 "127.0.0.1 local",
1155 "127.0.0.53",
1156 "127.0.1.1",
1157 ):
1158 self.assertNotIn(expected, contents)
1159
1160 def test_no_unified_hosts(self):
1161 kwargs = dict(

Callers

nothing calls this directly

Calls 1

write_opening_headerFunction · 0.90

Tested by

no test coverage detected