diff --git a/swh/model/hypothesis_strategies.py b/swh/model/hypothesis_strategies.py --- a/swh/model/hypothesis_strategies.py +++ b/swh/model/hypothesis_strategies.py @@ -54,21 +54,17 @@ ) from .swhids import ExtendedObjectType, ExtendedSWHID - -def pgsql_alphabet(blacklist_chars=[]): - pgsql_blacklist_chars = ["\u0000"] # postgresql does not like these - return characters( - blacklist_categories=("Cs",), - blacklist_characters=pgsql_blacklist_chars + blacklist_chars, - ) +pgsql_alphabet = characters( + blacklist_categories=("Cs",), blacklist_characters=["\u0000"] +) # postgresql does not like these def optional(strategy): return one_of(none(), strategy) -def pgsql_text(blacklist_chars=[]): - return text(alphabet=pgsql_alphabet(blacklist_chars)) +def pgsql_text(): + return text(alphabet=pgsql_alphabet) def sha1_git(): @@ -278,7 +274,7 @@ def directory_entries_d(): return builds( dict, - name=pgsql_text(blacklist_chars=["/"]).map(str.encode), + name=binary(), target=sha1_git(), type=sampled_from(["file", "dir", "rev"]), perms=sampled_from([perm.value for perm in DentryPerms]),