kytos-ng / maintenance

Kytos Maintenance Window NApp
https://kytos-ng.github.io/api/maintenance.html
0 stars 8 forks source link

API call /maintenance/{mw_id} on PATCH is returning misleading response status #10

Closed ajoaoff closed 3 years ago

ajoaoff commented 3 years ago

Original issue opened by @ArturoQuintana at https://github.com/kytos/maintenance/issues/44.

Example: payload1 = { "start": start.strftime(TIME_FMT), "end": new_time.strftime(TIME_FMT) } mw_api_url = KYTOS_API + '/maintenance/' + mw_id request = requests.patch(mw_api_url, data=json.dumps(payload1), headers={'Content-type': 'application/json'})

Reflected on end-to-end test: tests/test_e2e_15_maintenance.py::TestE2EMaintenance::test_036_patch_mw_on_switch_should_fail_wrong_payload_items_empty

Example: payload1 = { "start": start.strftime(TIME_FMT), "end": new_time.strftime(TIME_FMT) } mw_api_url = KYTOS_API + '/maintenance/' + mw_id request = requests.patch(mw_api_url, data=json.dumps(payload1), headers={'Content-type': 'application/json'})

Reflected on end-to-end test: tests/test_e2e_15_maintenance.py::TestE2EMaintenance::test_038_patch_mw_on_switch_should_fail_wrong_payload_no_items_field

Example: payload1 = { "description" } mw_api_url = KYTOS_API + '/maintenance/' + mw_id request = requests.patch(mw_api_url, data=json.dumps(payload1), headers={'Content-type': 'application/json'})

Reflected on end-to-end test: tests/test_e2e_15_maintenance.py::TestE2EMaintenance::test_039_patch_mw_on_switch_should_fail_wrong_payload