From b68311db95860ac1cab585a5ab66bd3b3abb765e Mon Sep 17 00:00:00 2001 From: Kota Tsuyuzaki Date: Tue, 15 Dec 2015 18:55:41 -0800 Subject: [PATCH] Fix reconciler test to calc lastmodified as UTC Swift reconciler calculates the last-modified date as UTC but current test calculates it as local time zone. It triggers unit test failure in non-UTC environment. This patch fixes the test to calculate the last-modified as UTC as well. Change-Id: Ia0053f350daf2cb8c61ac01a933924b6e4b0cb37 Closes-Bug: #1526588 --- test/unit/container/test_reconciler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/container/test_reconciler.py b/test/unit/container/test_reconciler.py index 974a35c7bc..771e9f83e3 100644 --- a/test/unit/container/test_reconciler.py +++ b/test/unit/container/test_reconciler.py @@ -36,7 +36,7 @@ from test.unit.common.middleware.helpers import FakeSwift def timestamp_to_last_modified(timestamp): - return datetime.fromtimestamp( + return datetime.utcfromtimestamp( float(Timestamp(timestamp))).strftime('%Y-%m-%dT%H:%M:%S.%f')