From 2e199be6048f37ba983b28c4ffff953b8a63594a Mon Sep 17 00:00:00 2001 From: Timur Alperovich Date: Thu, 23 Feb 2017 12:09:18 -0800 Subject: [PATCH] Probe tests fail, as requests checks for strings. The requests library checks that the headers are either strings or bytes. Currently, the two test_object_expirer tests fail with the message: InvalidHeader: Header value 1487879553 must be of type str or bytes, not The header in question is "x-delete-at". The patch converts it to a string, before making a Swift Client request. Change-Id: I738697cb6b696f0e346345f75e0069048961f2ff --- test/probe/test_object_expirer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/probe/test_object_expirer.py b/test/probe/test_object_expirer.py index c1f1b1e4..10c0999a 100644 --- a/test/probe/test_object_expirer.py +++ b/test/probe/test_object_expirer.py @@ -172,7 +172,7 @@ class TestObjectExpirer(ReplProbeTest): now = time.time() delete_at = int(now + 2.0) recreate_at = delete_at + 1.0 - put_object(headers={'X-Delete-At': delete_at, + put_object(headers={'X-Delete-At': str(delete_at), 'X-Timestamp': Timestamp(now).normal}) # some object servers stopped to make a situation that the @@ -255,7 +255,7 @@ class TestObjectExpirer(ReplProbeTest): obj_brain.stop_primary_half() now = time.time() delete_at = int(now + 2.0) - obj_brain.put_object({'X-Delete-At': delete_at}) + obj_brain.put_object({'X-Delete-At': str(delete_at)}) # make sure auto-created containers get in the account listing Manager(['container-updater']).once()