Funktionierender Prototyp des Serious Games zur Vermittlung von Wissen zu Software-Engineering-Arbeitsmodellen.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

strategies.py 1023B

1 year ago
123456789101112131415161718192021222324252627282930313233
  1. # Copyright (c) Twisted Matrix Laboratories.
  2. # See LICENSE for details.
  3. """
  4. Hypothesis strategies for values related to L{twisted.python}.
  5. """
  6. from hypothesis.strategies import SearchStrategy, characters, text
  7. def systemdDescriptorNames() -> SearchStrategy[str]:
  8. """
  9. Build strings that are legal values for the systemd
  10. I{FileDescriptorName} field.
  11. """
  12. # systemd.socket(5) says:
  13. #
  14. # > Names may contain any ASCII character, but must exclude control
  15. # > characters and ":", and must be at most 255 characters in length.
  16. return text(
  17. # The docs don't say there is a min size so I'm guessing...
  18. min_size=1,
  19. max_size=255,
  20. alphabet=characters(
  21. # These constraints restrict us to ASCII.
  22. min_codepoint=0,
  23. max_codepoint=127,
  24. # This one excludes control characters.
  25. blacklist_categories=("Cc",),
  26. # And this excludes the separator.
  27. blacklist_characters=(":",),
  28. ),
  29. )