mirror of
https://github.com/StevenBlack/hosts.git
synced 2024-07-07 13:02:27 +02: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:
commit
68c9d2f6b1
@ -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")
|
||||
|
@ -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")
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user