From bf2c6d1bda0be46f256ca6652f76a17486297c77 Mon Sep 17 00:00:00 2001 From: nicolargo Date: Sat, 5 Jul 2025 09:57:54 +0200 Subject: [PATCH] Add unit test for time zone in history --- tests/test_core.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_core.py b/tests/test_core.py index 8bac5c88..52886033 100755 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -13,7 +13,7 @@ import json import time import unittest -from datetime import datetime +from datetime import UTC, datetime from glances import __version__ from glances.events_list import GlancesEventsList @@ -147,6 +147,11 @@ class TestGlances(unittest.TestCase): plugin_instance.get_raw_history(first_history_field)[1][0], plugin_instance.get_raw_history(first_history_field)[0][0], ) + # Check time + self.assertEqual( + plugin_instance.get_raw_history(first_history_field)[1][0].tzinfo, + UTC, + ) # Update stats (add third element) plugin_instance.update()