diff --git a/test/unit/obj/test_server.py b/test/unit/obj/test_server.py index fab3a92d51..5826376f06 100755 --- a/test/unit/obj/test_server.py +++ b/test/unit/obj/test_server.py @@ -1073,6 +1073,13 @@ class TestObjectController(unittest.TestCase): resp = req.get_response(self.object_controller) self.assertEqual(resp.status_int, 400) + def test_PUT_bad_timestamp(self): + req = Request.blank( + '/sda1/p/a/c/o', environ={'REQUEST_METHOD': 'PUT'}, + headers={'X-Timestamp': 'bad'}) + resp = req.get_response(self.object_controller) + self.assertEqual(resp.status_int, 400) + def test_PUT_no_content_type(self): req = Request.blank( '/sda1/p/a/c/o', environ={'REQUEST_METHOD': 'PUT'}, @@ -3645,6 +3652,13 @@ class TestObjectController(unittest.TestCase): self.assertTrue(os.path.isfile(ts_1003_file)) self.assertEqual(len(os.listdir(os.path.dirname(ts_1003_file))), 1) + def test_DELETE_bad_timestamp(self): + req = Request.blank( + '/sda1/p/a/c/o', environ={'REQUEST_METHOD': 'DELETE'}, + headers={'X-Timestamp': 'bad'}) + resp = req.get_response(self.object_controller) + self.assertEqual(resp.status_int, 400) + def test_DELETE_succeeds_with_later_POST(self): t_put = next(self.ts).internal req = Request.blank('/sda1/p/a/c/o',