Update and move a comment to reflect reality

Early on the comment was true: If there was no host or intercept an
empty suite would be returned. This proved to mask errors in test
creation in large testing systems so a more visible and immediate
failure was implemented. The comment, however, did not get updated.
Now it is.
This commit is contained in:
Chris Dent 2015-10-11 12:03:07 +01:00
parent 415d76c2cf
commit 5fdeabb5cb

View File

@ -202,6 +202,8 @@ def build_tests(path, loader, host=None, port=8001, intercept=None,
:rtype: TestSuite containing multiple TestSuites (one for each YAML file).
"""
# Exit immediately if we have no host to access, either via a real host
# or an intercept.
if not (bool(host) ^ bool(intercept)):
raise AssertionError('must specify exactly one of host or intercept')
@ -219,8 +221,6 @@ def build_tests(path, loader, host=None, port=8001, intercept=None,
for handler in RESPONSE_HANDLERS + response_handlers:
handler(case.HTTPTestCase)
# Return an empty suite if we have no host to access, either via
# a real host or an intercept
for test_file in glob.iglob(yaml_file_glob):
if intercept:
host = str(uuid.uuid4())