Unittest - Enhanced support for testing hooks (wip)

* It is now possible to test:
  * Hook Input/Output on STDIN/STDOUT channels
  * Exit code of hook script
  * Execution count (how many times the hook was executed)
  * Timestamp execution (when was the hook executed - milisec resolution)
This commit is contained in:
Renato Alves 2014-11-01 23:42:25 +00:00
parent 9ea61e25e8
commit d261a38d17
9 changed files with 569 additions and 141 deletions

View file

@ -8,7 +8,7 @@ import atexit
from time import sleep
from subprocess import Popen
from .utils import (find_unused_port, release_port, port_used, run_cmd_wait,
which, parse_datafile, CURRENT_DIR, binary_location)
which, parse_datafile, DEFAULT_CERT_PATH, binary_location)
from .exceptions import CommandError
try:
@ -16,11 +16,6 @@ try:
except ImportError:
DEVNULL = open(os.devnull, 'w')
# Directory relative to basetest module location
DEFAULT_CERT_PATH = os.path.abspath(
os.path.join(CURRENT_DIR, "..", "test_certs")
)
class Taskd(object):
"""Manage a taskd instance