Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9346591
D6760.id24549.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D6760.id24549.diff
View Options
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,17 +54,21 @@
)
from .swhids import ExtendedObjectType, ExtendedSWHID
-pgsql_alphabet = characters(
- blacklist_categories=("Cs",), blacklist_characters=["\u0000"]
-) # postgresql does not like these
+
+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,
+ )
def optional(strategy):
return one_of(none(), strategy)
-def pgsql_text():
- return text(alphabet=pgsql_alphabet)
+def pgsql_text(blacklist_chars=[]):
+ return text(alphabet=pgsql_alphabet(blacklist_chars))
def sha1_git():
@@ -274,7 +278,7 @@
def directory_entries_d():
return builds(
dict,
- name=binary(),
+ name=pgsql_text(blacklist_chars=["/"]).map(str.encode),
target=sha1_git(),
type=sampled_from(["file", "dir", "rev"]),
perms=sampled_from([perm.value for perm in DentryPerms]),
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jul 3, 4:13 PM (2 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3218555
Attached To
D6760: hypothesis_strategies: Ensure to generate valid directory entry name
Event Timeline
Log In to Comment