From 2aae1dc59a041d95c04da59b6c048974c309759c Mon Sep 17 00:00:00 2001 From: Huong Nguyen Date: Fri, 17 Jan 2025 17:29:57 +0700 Subject: [PATCH] include test for getting version Signed-off-by: Huong Nguyen --- package/tests/test_api/test_rest/test_router.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/package/tests/test_api/test_rest/test_router.py b/package/tests/test_api/test_rest/test_router.py index 523043d96..6d29f3996 100644 --- a/package/tests/test_api/test_rest/test_router.py +++ b/package/tests/test_api/test_rest/test_router.py @@ -90,3 +90,16 @@ def test_metadata( mock_get_metadata_response.assert_called_once() assert response.status_code == expected_status_code assert response.json() == expected_response + +def test_version(client): + response = client.get("/api/version") + assert response.status_code == 200 + + json_response = response.json() + assert "installed" in json_response + assert "isOutdated" in json_response + assert "latest" in json_response + + assert isinstance(json_response["installed"], str) + assert isinstance(json_response["isOutdated"], bool) + assert isinstance(json_response["latest"], str)