From 909b6f9506bd666b41bfef3c1a9a3f925fb4e550 Mon Sep 17 00:00:00 2001 From: MatteoGuarnaccia5 Date: Mon, 24 Jun 2024 09:59:03 +0000 Subject: [PATCH] removed `severity` from scheduled maintenance #88 --- README.md | 2 -- ldap_jwt_auth/core/schemas.py | 3 +-- maintenance/scheduled_maintenance.json | 3 +-- test/unit/maintenance/test_maintenance.py | 5 ++--- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 598731e..cd957ee 100644 --- a/README.md +++ b/README.md @@ -236,8 +236,6 @@ The `maintenance` folder at the root of the project directory contains two json index number of the file. A workaround is to create a new file using the `maintenance.json` or `scheduled_maintenance.json` file, apply your changes in the new file, and then overwrite the `maintenance.json` / `scheduled_maintenance.json` file with the content of the new file, see below an example for `maintenance.json` file. -**_The `severity` in `scheduled_maintenance.json` should be one of the following values: `'success' | 'warning' | 'error' | 'information'`_** - ```bash cp maintenance/maintenance.json new_maintenance.json vim new_maintenance.json diff --git a/ldap_jwt_auth/core/schemas.py b/ldap_jwt_auth/core/schemas.py index 75b5c64..d95dea2 100644 --- a/ldap_jwt_auth/core/schemas.py +++ b/ldap_jwt_auth/core/schemas.py @@ -30,5 +30,4 @@ class ScheduledMaintenanceState(MaintenanceState): """ Model for scheduled maintenance state """ - - severity: Optional[str] + \ No newline at end of file diff --git a/maintenance/scheduled_maintenance.json b/maintenance/scheduled_maintenance.json index d18716b..4c2098e 100644 --- a/maintenance/scheduled_maintenance.json +++ b/maintenance/scheduled_maintenance.json @@ -1,5 +1,4 @@ { "show": false, - "message": "Maintenance scheduled for tomorrow at 12:00", - "severity": "warning" + "message": "Maintenance scheduled for tomorrow at 12:00" } diff --git a/test/unit/maintenance/test_maintenance.py b/test/unit/maintenance/test_maintenance.py index 59b591d..c1bfbab 100644 --- a/test/unit/maintenance/test_maintenance.py +++ b/test/unit/maintenance/test_maintenance.py @@ -59,7 +59,7 @@ def test_get_scheduled_maintenance_state(): """ Test returning scheduled maintenance state schema """ - mock_scheduled_maintenance_data = {"show": True, "message": "This is a test message", "severity": "important"} + mock_scheduled_maintenance_data = {"show": True, "message": "This is a test message"} mock_scheduled_maintenance_file = json.dumps(mock_scheduled_maintenance_data) with ( @@ -71,14 +71,13 @@ def test_get_scheduled_maintenance_state(): assert response.show is True assert response.message == "This is a test message" - assert response.severity == "important" def test_get_scheduled_maintenance_state_invalid_file(): """ Test returning scheduled maintenance state schema when file is invalid """ - mock_scheduled_maintenance_data = {"show": "True", "message": "This is a test message", "severity": True} + mock_scheduled_maintenance_data = {"show": "True", "message": "This is a test message"} mock_scheduled_maintenance_file = json.dumps(mock_scheduled_maintenance_data) with (