patman: Correct unit tests to run correctly

It seems that doctest behaves differently now, and some of the unit tests
do not run. Adjust the tests to work correctly.

 ./tools/patman/patman --test
<unittest.result.TestResult run=10 errors=0 failures=0>

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2014-08-28 09:43:35 -06:00
parent 6ba5737ff0
commit e752edcb6b
4 changed files with 22 additions and 14 deletions

View File

@@ -478,13 +478,13 @@ def LookupEmail(lookup_name, alias=None, raise_on_error=True, level=0):
...
OSError: Recursive email alias at 'other'
>>> LookupEmail('odd', alias, raise_on_error=False)
\033[1;31mAlias 'odd' not found\033[0m
Alias 'odd' not found
[]
>>> # In this case the loop part will effectively be ignored.
>>> LookupEmail('loop', alias, raise_on_error=False)
\033[1;31mRecursive email alias at 'other'\033[0m
\033[1;31mRecursive email alias at 'john'\033[0m
\033[1;31mRecursive email alias at 'mary'\033[0m
Recursive email alias at 'other'
Recursive email alias at 'john'
Recursive email alias at 'mary'
['j.bloggs@napier.co.nz', 'm.poppins@cloud.net']
"""
if not alias: