From 97ad69b84aa6df08dcde8cf7040fe2cc42cec133 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Simon=20K=C3=BCnzel?= <simonk@fsmpi.rwth-aachen.de>
Date: Thu, 23 May 2024 19:19:18 +0200
Subject: [PATCH] Fix announcement test

---
 api_specification.md |  4 ++--
 tests/routes/site.py | 15 ++++++++++-----
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/api_specification.md b/api_specification.md
index 883dcf8..fe095fe 100644
--- a/api_specification.md
+++ b/api_specification.md
@@ -58,8 +58,6 @@ The current site status can be retrieved with `GET /status`. It can be in three
   * 'This may be used while the site is [read-only](#site-status).'
 * `unavailable`: The site is unavailable and the only route you can call is `GET /status`
 
-### Miscellaneous
-
 ---
 
 #### `GET /status`
@@ -110,6 +108,8 @@ Returns `200 OK` if the site is ready to answer requests, otherwise `503 SERVICE
 
 ---
 
+### Miscellaneous
+
 #### `GET /homepage`
 
 This may be used while the site is [read-only](#site-status).
diff --git a/tests/routes/site.py b/tests/routes/site.py
index 10f1bec..90b437e 100644
--- a/tests/routes/site.py
+++ b/tests/routes/site.py
@@ -4,24 +4,28 @@ from object_data import *
 
 class SiteTest(ApiTest):
     
-    def test_announcements(self):
+    def test_status(self):
+        # TODO test live config
         self.do_json_request(
             "GET",
-            "/announcements",
+            "/status",
             None,
             {
+                "status": "available",
                 "announcements": [
                     TEST_DATA_ANNOUNCEMENT_1,
                     TEST_DATA_ANNOUNCEMENT_2
                 ]
             },
-            ["announcements"]
+            ignore_array_order_keys=["announcements"],
+            ignore_value_keys=["is_debug"]
         )
         self.do_json_request(
             "GET",
-            "/announcements",
+            "/status",
             None,
             {
+                "status": "available",
                 "announcements": [
                     TEST_DATA_ANNOUNCEMENT_1_MOD,
                     TEST_DATA_ANNOUNCEMENT_2_MOD,
@@ -30,7 +34,8 @@ class SiteTest(ApiTest):
                     TEST_DATA_ANNOUNCEMENT_5_MOD
                 ]
             },
-            ["announcements"],
+            ignore_array_order_keys=["announcements"],
+            ignore_value_keys=["is_debug"],
             use_moderator_login=True
         )
     
-- 
GitLab