From f9167b6b07777177ff26042c0d385df181c9e100 Mon Sep 17 00:00:00 2001
From: ahmedk <karim.ahmed@xfel.eu>
Date: Mon, 3 May 2021 17:12:58 +0200
Subject: [PATCH] fix dates in test to be adaptive for test pdus

---
 tests/test_cal_tools.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tests/test_cal_tools.py b/tests/test_cal_tools.py
index 6bc8ae1cd..8e358a68b 100644
--- a/tests/test_cal_tools.py
+++ b/tests/test_cal_tools.py
@@ -55,13 +55,15 @@ cal_db_interface = "tcp://max-exfl017:8020"
 
 def test_get_pdu_from_db():
 
+    snapshot_at = datetime.now().strftime('%Y-%m-%d %H:%M:%S%z')
+
     # A karabo_da str returns a list of one element.
     pdu_dict = get_pdu_from_db(karabo_id="TEST_DET_CI-2",
                                karabo_da="TEST_DAQ_DA_01",
                                constant=constant,
                                condition=condition,
                                cal_db_interface=cal_db_interface,
-                               snapshot_at="2021-03-01 09:44:00+00:00",
+                               snapshot_at=snapshot_at,
                                timeout=30000)
     assert len(pdu_dict) == 1
     assert pdu_dict[0] == 'PHYSICAL_DETECTOR_UNIT-1_DO_NOT_DELETE'
@@ -73,7 +75,7 @@ def test_get_pdu_from_db():
                                constant=constant,
                                condition=condition,
                                cal_db_interface=cal_db_interface,
-                               snapshot_at="2021-03-01 09:44:00+00:00",
+                               snapshot_at=snapshot_at,
                                timeout=30000)
 
     assert pdu_dict == ['PHYSICAL_DETECTOR_UNIT-1_DO_NOT_DELETE',
@@ -86,7 +88,7 @@ def test_get_pdu_from_db():
                                constant=constant,
                                condition=condition,
                                cal_db_interface="tcp://max-exfl017:8020",
-                               snapshot_at="2021-03-01 09:44:00+00:00",
+                               snapshot_at=snapshot_at,
                                timeout=30000)
 
     assert len(pdu_dict) == 3
-- 
GitLab