Skip to content
Snippets Groups Projects
Commit c3a7e4ee authored by vlorentz's avatar vlorentz
Browse files

Prevent Hypothesis from writing the null character in the 'reason' field.

pgsql does not support it.
parent b42d35c1
No related branches found
No related tags found
No related merge requests found
...@@ -20,6 +20,15 @@ from .model import ( ...@@ -20,6 +20,15 @@ from .model import (
from .identifiers import snapshot_identifier, identifier_to_bytes from .identifiers import snapshot_identifier, identifier_to_bytes
pgsql_alphabet = characters(
blacklist_categories=('Cs', ),
blacklist_characters=['\u0000']) # postgresql does not like these
def pgsql_text():
return text(alphabet=pgsql_alphabet)
def sha1_git(): def sha1_git():
return binary(min_size=20, max_size=20) return binary(min_size=20, max_size=20)
...@@ -89,10 +98,7 @@ def releases(draw): ...@@ -89,10 +98,7 @@ def releases(draw):
def revision_metadata(): def revision_metadata():
alphabet = characters( return dictionaries(pgsql_text(), pgsql_text())
blacklist_categories=('Cs', ),
blacklist_characters=['\u0000']) # postgresql does not like these
return dictionaries(text(alphabet=alphabet), text(alphabet=alphabet))
def revisions(): def revisions():
...@@ -125,7 +131,7 @@ def directories(): ...@@ -125,7 +131,7 @@ def directories():
def contents(draw): def contents(draw):
(status, data, reason) = draw(one_of( (status, data, reason) = draw(one_of(
tuples(just('visible'), binary(), none()), tuples(just('visible'), binary(), none()),
tuples(just('absent'), none(), text()), tuples(just('absent'), none(), pgsql_text()),
tuples(just('hidden'), none(), none()), tuples(just('hidden'), none(), none()),
)) ))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment