Expected failure for server down
continuous-integration/drone/push Build is passing

Was even een les om te leren. Nu checkt hij eerst voor een 5xx response.
This commit is contained in:
2022-12-02 19:35:29 +01:00
parent b0901cb2e9
commit 3ef817c6aa
+3 -1
View File
@@ -21,7 +21,9 @@ class TestGeneral(unittest.TestCase):
def test_playlist(self):
data = self.cog.get_playlist_json()
with self.subTest(msg="Reddit doesn't return 200"):
if data.status_code >= 500:
self.skipTest(f"Server at {self.cog.muzak_url} has an error")
with self.subTest(msg=f"{self.cog.muzak_url} doesn't return 200"):
self.assertEqual(data.status_code, 200)
with self.subTest(msg="Not a good response"):
self.assertIsInstance(data, requests.Response)