Skip to content

Commit

Permalink
updated testcases
Browse files Browse the repository at this point in the history
Signed-off-by: msvinaykumar <vinakuma@redhat.com>
  • Loading branch information
msvinaykumar committed Aug 23, 2023
1 parent c0e00bc commit ecb6de4
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -481,13 +481,12 @@ def test_update_results_with_same_result(cluster_type):
interval_end_time = result_json_data[0]['interval_end_time']
interval_start_time = result_json_data[0]['interval_start_time']

TIMESTAMP_PRESENT_MSG = 'A record with the name %s already exists within the timestamp range starting ' \
'from %s and ending on %s.' % (experiment_name, interval_start_time, interval_end_time)
TIMESTAMP_PRESENT_MSG = 'An entry for this record already exists!'

print(TIMESTAMP_PRESENT_MSG)
print(data['data'][0]['errorReasons'][0])
print(data['data'][0]['errors']["409"])
assert data['message'] == 'Out of a total of 1 records, 1 failed to save'
assert data['data'][0]['errorReasons'][0] == TIMESTAMP_PRESENT_MSG
assert data['data'][0]['errors']["409"] == TIMESTAMP_PRESENT_MSG

response = delete_experiment(input_json_file)
print("delete exp = ", response.status_code)
Expand Down Expand Up @@ -535,12 +534,12 @@ def test_update_results_with_valid_and_invalid_interval_duration(test_name, inte
assert response.status_code == ERROR_STATUS_CODE
assert data['status'] == ERROR_STATUS
assert data['message'] == 'Out of a total of 1 records, 1 failed to save'
assert data['data'][0]['errorReasons'][0] == UPDATE_RESULTS_DATE_PRECEDE_ERROR_MSG
assert data['data'][0]['errors']['400'] == UPDATE_RESULTS_DATE_PRECEDE_ERROR_MSG
else:
assert response.status_code == ERROR_STATUS_CODE
assert data['status'] == ERROR_STATUS
assert data['message'] == 'Out of a total of 1 records, 1 failed to save'
assert data['data'][0]['errorReasons'][0] == INVALID_INTERVAL_DURATION_MSG
assert data['data'][0]['errors']['400'] == INVALID_INTERVAL_DURATION_MSG

response = delete_experiment(input_json_file)
print("delete exp = ", response.status_code)

0 comments on commit ecb6de4

Please sign in to comment.