Merge "Add test_PUT/DELETE_bad_timestamp in obj/test_server"
This commit is contained in:
commit
d91dfcd0a4
@ -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',
|
||||
|
Loading…
Reference in New Issue
Block a user