fix tests

This commit is contained in:
yangdsh 2020-04-16 02:29:00 +00:00 committed by Dana Van Aken
parent 0bf2da738f
commit 2f7396d275
2 changed files with 3 additions and 5 deletions

View File

@ -224,7 +224,7 @@ class DataUtil(object):
session_knobs.append(knob)
knob_cat = [k['name'] for k in session_knobs]
if knob_cat == knob_labels:
if len(knob_cat) == 0 or knob_cat == knob_labels:
# Nothing to do!
return knob_matrix, knob_labels

View File

@ -1731,10 +1731,8 @@ def tuner_status_test(request, upload_code): # pylint: disable=unused-argument,
name, expected_name))
if session.tuning_session == "tuning_session":
if session.algorithm == AlgorithmType.GPR or session.algorithm == AlgorithmType.DNN:
if isinstance(result, dict) is False:
return HttpResponse("Failure: wrong result for task {}".format(name))
if 'mapped_workload_id' not in result:
return HttpResponse("Failure: wrong result for task {}".format(name))
if isinstance(result, dict) is True:
return HttpResponse("Failure: map workload when there is only 1 workload")
elif i == 2:
expected_name = TaskType.TYPE_NAMES[TaskType.RECOMMENDATION]
if name != expected_name: