kytos-ng / maintenance

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

Fix return codes and messages #12

Closed ajoaoff closed 3 years ago

ajoaoff commented 3 years ago

Fixes #10 and fixes #9.

Description of the change

This PR changes the way error codes are returned, using werkzeug classes. Also, fix the error where empty items were allowed

Tests were modified to reflect changes in code.

ArturoQuintana commented 3 years ago

@ajoaoff after applying the patches, we have detected that the following payload is still throwing the same error (the return code is 200 instead of 400 as expected for an empty items field):

payload1 = {
            "start": start.strftime(TIME_FMT),
            "end": new_time.strftime(TIME_FMT),
            "items": []
        }