qutebrowser/tests/unit
Ryan Roden-Corrent 888a1b8c57 Append multiple history backups on import.
Previously, a successful import of the text history into sqlite would
move 'history' to 'history.bak'. If history.bak already existed, this
would overwrite it on unix and fail on windows.

With this patch, the most recently imported history is appended to
history.bak to avoid data loss.

Resolves #3005.

A few other options I considered:

1. os.replace:
    - fast, simple, no error on Windows
    - potential data loss
2. numbered backups (.bak.1, .bak.2, ...):
    - fast, no data loss, but more complex
3. append each line to the backup as it is read:
    - more efficient than current patch (no need to read history twice)
    - potentially duplicate data if backup fails
2017-09-23 13:06:11 -04:00
..
browser Append multiple history backups on import. 2017-09-23 13:06:11 -04:00
commands Remove unused import 2017-09-22 08:23:06 +02:00
completion Use .assert_not_called() for mocks 2017-09-22 19:58:38 +02:00
config Revert "Fix NUL byte error handling on Python 3.4" 2017-09-22 22:30:02 +02:00
javascript Finally update copyrights... 2017-05-09 21:37:03 +02:00
keyinput Fix modeparser tests 2017-09-22 19:49:52 +02:00
mainwindow Use upper-case Monospace in test_progress_affecting_statusbar_height 2017-09-12 22:51:52 +02:00
misc Use .assert_not_called() for mocks 2017-09-22 19:58:38 +02:00
scripts Use a pytest marker to fake an OS 2017-09-20 11:30:18 +02:00
utils Use .assert_not_called() for mocks 2017-09-22 19:58:38 +02:00
test_app.py Finally update copyrights... 2017-05-09 21:37:03 +02:00