test(s3): compare tagged object expiry against UTC

This commit is contained in:
overtrue
2026-12-02 07:31:47 +08:00
parent 744ec5fb1d
commit 39bfa6ccf6
@@ -0,0 +1,29 @@
--- a/s3tests/functional/test_s3.py
+++ b/s3tests/functional/test_s3.py
@@ -9230,7 +9230,7 @@
# stat the object, check header
response = client.head_object(Bucket=bucket_name, Key=key1)
assert response['ResponseMetadata']['HTTPStatusCode'] == 200
- assert check_lifecycle_expiration_header(response, datetime.datetime.now(None), 'rule1', 1)
+ assert check_lifecycle_expiration_header(response, _utcnow_naive(), 'rule1', 1)
# test that header is not returning when it should not
lifecycle={
@@ -9252,7 +9252,7 @@
# stat the object, check header
response = client.head_object(Bucket=bucket_name, Key=key1)
assert response['ResponseMetadata']['HTTPStatusCode'] == 200
- assert check_lifecycle_expiration_header(response, datetime.datetime.now(None), 'rule1', 1) == False
+ assert check_lifecycle_expiration_header(response, _utcnow_naive(), 'rule1', 1) == False
@pytest.mark.lifecycle
@pytest.mark.lifecycle_expiration
@@ -9298,7 +9298,7 @@
# stat the object, check header
response = client.head_object(Bucket=bucket_name, Key=key1)
assert response['ResponseMetadata']['HTTPStatusCode'] == 200
- assert check_lifecycle_expiration_header(response, datetime.datetime.now(None), 'rule1', 1) == False
+ assert check_lifecycle_expiration_header(response, _utcnow_naive(), 'rule1', 1) == False
@pytest.mark.lifecycle
def test_lifecycle_set_noncurrent():