mirror of
https://github.com/StevenBlack/hosts.git
synced 2024-07-04 03:26:12 +02:00
Change strategy regarding #1332.
Instead of changing the directory separator globally, we change it only when we generate/update the readme data file.
This commit is contained in:
parent
b8b067b6ab
commit
abf763e9a0
|
@ -64,7 +64,7 @@ class Base(unittest.TestCase):
|
|||
@property
|
||||
def sep(self):
|
||||
if platform.system().lower() == "windows":
|
||||
return "/"
|
||||
return "\\"
|
||||
return os.sep
|
||||
|
||||
def assert_called_once(self, mock_method):
|
||||
|
@ -1125,12 +1125,13 @@ class TestUpdateReadmeData(BaseMockDir):
|
|||
)
|
||||
update_readme_data(self.readme_file, **kwargs)
|
||||
|
||||
if platform.system().lower() == "windows":
|
||||
sep = "/"
|
||||
else:
|
||||
sep = self.sep
|
||||
|
||||
expected = {
|
||||
"base": {
|
||||
"location": "foo" + self.sep,
|
||||
"sourcesdata": "hosts",
|
||||
"entries": 5,
|
||||
},
|
||||
"base": {"location": "foo" + sep, "sourcesdata": "hosts", "entries": 5},
|
||||
"foo": "bar",
|
||||
}
|
||||
|
||||
|
@ -1147,8 +1148,13 @@ class TestUpdateReadmeData(BaseMockDir):
|
|||
)
|
||||
update_readme_data(self.readme_file, **kwargs)
|
||||
|
||||
if platform.system().lower() == "windows":
|
||||
sep = "/"
|
||||
else:
|
||||
sep = self.sep
|
||||
|
||||
expected = {
|
||||
"base": {"location": "foo" + self.sep, "sourcesdata": "hosts", "entries": 5}
|
||||
"base": {"location": "foo" + sep, "sourcesdata": "hosts", "entries": 5}
|
||||
}
|
||||
|
||||
with open(self.readme_file, "r") as f:
|
||||
|
@ -1167,12 +1173,13 @@ class TestUpdateReadmeData(BaseMockDir):
|
|||
)
|
||||
update_readme_data(self.readme_file, **kwargs)
|
||||
|
||||
if platform.system().lower() == "windows":
|
||||
sep = "/"
|
||||
else:
|
||||
sep = self.sep
|
||||
|
||||
expected = {
|
||||
"com-org": {
|
||||
"location": "foo" + self.sep,
|
||||
"sourcesdata": "hosts",
|
||||
"entries": 5,
|
||||
}
|
||||
"com-org": {"location": "foo" + sep, "sourcesdata": "hosts", "entries": 5}
|
||||
}
|
||||
|
||||
with open(self.readme_file, "r") as f:
|
||||
|
|
Loading…
Reference in New Issue
Block a user