|
@@ -649,11 +649,14 @@ def _sanity_check(engine, test_query=None):
|
|
|
if not test_query:
|
|
|
test_query = 'format date bash'
|
|
|
|
|
|
- args = vars(parser.parse_args(('-j ' + test_query).split()))
|
|
|
+ args = vars(parser.parse_args(test_query.split()))
|
|
|
args['search_engine'] = engine
|
|
|
|
|
|
try:
|
|
|
- assert isinstance(howdoi(args).encode('utf-8', 'ignore'), list)
|
|
|
+ result = howdoi(args)
|
|
|
+ # Perhaps better to use `-j` and then check for an error message
|
|
|
+ # rather than trying to enumerate all the error strings
|
|
|
+ assert "Sorry" not in result and "Unable to" not in result
|
|
|
except AssertionError as exc:
|
|
|
if engine == 'google':
|
|
|
raise GoogleValidationError from exc
|