Commit 59834a17 authored by Lisa Casino's avatar Lisa Casino

slapos/collect: fix test

parent 3cea76c1
Pipeline #16374 failed with stage
in 0 seconds
...@@ -569,11 +569,12 @@ class TestCollectSnapshot(unittest.TestCase): ...@@ -569,11 +569,12 @@ class TestCollectSnapshot(unittest.TestCase):
date = datetime.utcnow().date() date = datetime.utcnow().date()
time = datetime.utcnow().time().strftime("%H:%M:%S") time = datetime.utcnow().time().strftime("%H:%M:%S")
time_earlier = (datetime.utcnow() - \ datetime_earlier = datetime.utcnow() - timedelta(hours=3)
timedelta(hours=3)).time().strftime("%H:%M:%S") date_earlier = datetime_earlier.date()
time_earlier = datetime_earlier.time().strftime("%H:%M:%S")
database.connect() database.connect()
database.inserFolderSnapshot('fakeuser0', '1.0', date, time_earlier) database.inserFolderSnapshot('fakeuser0', '1.0', date_earlier, time_earlier)
database.commit() database.commit()
database.close() database.close()
...@@ -583,11 +584,12 @@ class TestCollectSnapshot(unittest.TestCase): ...@@ -583,11 +584,12 @@ class TestCollectSnapshot(unittest.TestCase):
user._insertDiskSnapShot(database, date, time) user._insertDiskSnapShot(database, date, time)
update_folder_size_call.assert_called_once() update_folder_size_call.assert_called_once()
time_earlier = (datetime.utcnow() - \ datetime_earlier = datetime.utcnow() - timedelta(minutes=10)
timedelta(minutes=10)).time().strftime("%H:%M:%S") date_earlier = datetime_earlier.date()
time_earlier = datetime_earlier.time().strftime("%H:%M:%S")
database.connect() database.connect()
database.inserFolderSnapshot('fakeuser0', '1.0', date, time_earlier) database.inserFolderSnapshot('fakeuser0', '1.0', date_earlier, time_earlier)
database.commit() database.commit()
database.close() database.close()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment