summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2021-03-02 17:43:00 +0100
committerFlorian Bruhin <me@the-compiler.org>2021-03-02 17:54:32 +0100
commit2cbbbe54c64c23fc9bde6016a23ca38082849dc5 (patch)
tree6874a49f6ca5877d342f68d7b56a4bf3ae529018
parent70f778d41832d8811105c6aae09b6e687e9835a7 (diff)
downloadqutebrowser-2cbbbe54c64c23fc9bde6016a23ca38082849dc5.tar.gz
qutebrowser-2cbbbe54c64c23fc9bde6016a23ca38082849dc5.zip
tests: Disallow NUL for filesystem tests
From what I can see, there's no way for an user to enter a NUL byte. Closes #6223
-rw-r--r--tests/unit/completion/test_models.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/unit/completion/test_models.py b/tests/unit/completion/test_models.py
index 8a6b24557..3b8aba4fd 100644
--- a/tests/unit/completion/test_models.py
+++ b/tests/unit/completion/test_models.py
@@ -28,7 +28,7 @@ from datetime import datetime
from unittest import mock
import hypothesis
-import hypothesis.strategies
+import hypothesis.strategies as hst
import pytest
from PyQt5.QtCore import QUrl, QDateTime
try:
@@ -459,9 +459,9 @@ def test_filesystem_completion_model_interface(info, local_files_path):
@hypothesis.given(
- as_uri=hypothesis.strategies.booleans(),
- add_sep=hypothesis.strategies.booleans(),
- text=hypothesis.strategies.text(),
+ as_uri=hst.booleans(),
+ add_sep=hst.booleans(),
+ text=hst.text(alphabet=hst.characters(blacklist_categories=['Cc'], blacklist_characters='\x00')),
)
def test_filesystem_completion_hypothesis(info, as_uri, add_sep, text):
if as_uri:
@@ -1445,7 +1445,7 @@ def undo_completion_retains_sort_order(tabbed_browser_stubs, info):
_check_completions(model, {"Closed tabs": expected})
-@hypothesis.given(text=hypothesis.strategies.text())
+@hypothesis.given(text=hst.text())
def test_listcategory_hypothesis(text):
"""Make sure we can't produce invalid patterns."""
cat = listcategory.ListCategory("test", [])