mirror of
https://github.com/StevenBlack/hosts.git
synced 2026-07-01 02:36:52 +00:00
Review of the notion of keepdomaincomments
This patch fix StevenBlack/hosts#777 This patch: * Change the default state of keepdomaincomments. * Indeed, comments are now displayed by default. * But if you don't need comments, feel free to use the argument. * Delete the requirement input when calling the `-k` argument. * Update tests case regarding the new state of keepdomaincomments.
This commit is contained in:
@@ -86,7 +86,7 @@ class TestGetDefaults(Base):
|
||||
"replace": False,
|
||||
"backup": False,
|
||||
"skipstatichosts": False,
|
||||
"keepdomaincomments": False,
|
||||
"keepdomaincomments": True,
|
||||
"extensionspath": "foo" + self.sep + "extensions",
|
||||
"extensions": [],
|
||||
"compress": False,
|
||||
@@ -753,10 +753,12 @@ class TestStripRule(Base):
|
||||
self.assertEqual(output, line)
|
||||
|
||||
def test_strip_more_than_two(self):
|
||||
comment = " # comments here galore"
|
||||
|
||||
for line in ["0.0.0.0 twitter.com", "127.0.0.1 facebook.com",
|
||||
"8.8.8.8 google.com", "1.2.3.4 foo.bar.edu"]:
|
||||
output = strip_rule(line + " # comments here galore")
|
||||
self.assertEqual(output, line)
|
||||
output = strip_rule(line + comment)
|
||||
self.assertEqual(output, line + comment)
|
||||
|
||||
|
||||
class TestWriteOpeningHeader(BaseMockDir):
|
||||
|
||||
Reference in New Issue
Block a user