workercommands.py 641 B

12345678910111213141516171819202122232425262728293031
  1. # Copyright (c) Twisted Matrix Laboratories.
  2. # See LICENSE for details.
  3. """
  4. Commands for telling a worker to load tests or run tests.
  5. @since: 12.3
  6. """
  7. from twisted.protocols.amp import Command, String, Boolean, Unicode
  8. from twisted.python.compat import _PY3
  9. NativeString = Unicode if _PY3 else String
  10. class Run(Command):
  11. """
  12. Run a test.
  13. """
  14. arguments = [(b'testCase', NativeString())]
  15. response = [(b'success', Boolean())]
  16. class Start(Command):
  17. """
  18. Set up the worker process, giving the running directory.
  19. """
  20. arguments = [(b'directory', NativeString())]
  21. response = [(b'success', Boolean())]