kytos-ng / maintenance

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

API call /maintenance on POST is returning misleading response status #9

Closed ajoaoff closed 3 years ago

ajoaoff commented 3 years ago

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

Example: # Sets up a wrong maintenance window data payload = { "description": "my MW on switch 2", "start": start.strftime(TIME_FMT), "end": end.strftime(TIME_FMT), "items": [] } reflected on end-to-end test: tests/test_e2e_15_maintenance.py::TestE2EMaintenance::test_024_create_mw_on_switch_should_fail_items_empty

In the case where the payload does not have an items field, it is returning 500 when should be 400. Example: # Sets up a wrong maintenance window data payload = { "description": "my MW on switch 2", "start": start.strftime(TIME_FMT), "end": end.strftime(TIME_FMT) } reflected on end-to-end test: tests/test_e2e_15_maintenance.py::TestE2EMaintenance::test_026_create_mw_on_switch_should_fail_no_items_field_on_payload

Example: # Sets up a wrong maintenance window data payload = {"a"} reflected on end-to-end test: tests/test_e2e_15_maintenance.py::TestE2EMaintenance::test_029_create_mw_on_switch_should_fail_wrong_payload