mirror of
https://github.com/StevenBlack/hosts.git
synced 2026-11-24 19:12:31 +00:00
Merge pull request #1246 from gprestes/gprestes-patch-1
Restore filename to follow the hosts-%Y-%m-%d-%H-%M-%S format
This commit is contained in:
2 files changed
+2
-2
No files matched your search
@@ -1376,7 +1376,7 @@ class TestRemoveOldHostsFile(BaseMockDir):
|
||||
contents = f.read()
|
||||
self.assertEqual(contents, "")
|
||||
|
||||
@mock.patch("time.strftime", return_value="-new")
|
||||
@mock.patch("time.strftime", return_value="new")
|
||||
def test_remove_hosts_file_backup(self, _):
|
||||
with open(self.hosts_file, "w") as f:
|
||||
f.write("foo")
|
||||
|
||||
+1
-1
@@ -1345,7 +1345,7 @@ def remove_old_hosts_file(old_file_path, backup):
|
||||
open(old_file_path, "a").close()
|
||||
|
||||
if backup:
|
||||
backup_file_path = old_file_path + "{}".format(
|
||||
backup_file_path = old_file_path + "-{}".format(
|
||||
time.strftime("%Y-%m-%d-%H-%M-%S")
|
||||
)
|
||||
|
||||
|
||||
Reference in new issue
Block a user