summaryrefslogtreecommitdiff
path: root/tests/unit/browser/test_history.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/browser/test_history.py')
-rw-r--r--tests/unit/browser/test_history.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/unit/browser/test_history.py b/tests/unit/browser/test_history.py
index 9b08de30d..1ca708ec8 100644
--- a/tests/unit/browser/test_history.py
+++ b/tests/unit/browser/test_history.py
@@ -508,6 +508,28 @@ class TestCompletionMetaInfo:
metainfo['excluded_patterns'] = value
assert metainfo['excluded_patterns'] == value
+ # FIXME: It'd be good to test those two things via WebHistory (and not just
+ # CompletionMetaInfo in isolation), but we can't do that right now - see the
+ # docstring of TestRebuild for details.
+
+ def test_recovery_no_key(self, metainfo):
+ metainfo.delete('key', 'force_rebuild')
+
+ with pytest.raises(sql.BugError, match='No result for single-result query'):
+ metainfo['force_rebuild']
+
+ metainfo.try_recover()
+ assert not metainfo['force_rebuild']
+
+ def test_recovery_no_table(self, metainfo):
+ sql.Query("DROP TABLE CompletionMetaInfo").run()
+
+ with pytest.raises(sql.BugError, match='no such table: CompletionMetaInfo'):
+ metainfo['force_rebuild']
+
+ metainfo.try_recover()
+ assert not metainfo['force_rebuild']
+
class TestHistoryProgress: