From abe0275a5824a23c8655f94042e640903174bc3b Mon Sep 17 00:00:00 2001 From: Florian Bezannier Date: Wed, 23 Jun 2021 14:42:31 +0200 Subject: [PATCH] update test --- test/test_unit.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/test_unit.py b/test/test_unit.py index abe7af5..060ff1d 100644 --- a/test/test_unit.py +++ b/test/test_unit.py @@ -4,6 +4,8 @@ import os import unittest from datetime import datetime, timedelta +from pytz import UTC + import libs.config from psa_connectedcar import ApiClient import psa_connectedcar as psacc @@ -78,8 +80,8 @@ class TestUnit(unittest.TestCase): assert CarModel.find_model_by_vin("VXKUHZKXZL").name == "corsa-e" def test_c02_signal_cache(self): - start = datetime.now() - timedelta(minutes=30) - end = datetime.now() + start = datetime.utcnow().replace(tzinfo=UTC) - timedelta(minutes=30) + end = datetime.utcnow().replace(tzinfo=UTC) Ecomix._cache = {'FR': [[start - timedelta(days=1), 100], [start + timedelta(minutes=1), 10], [start + timedelta(minutes=2), 20],