def test_gluster_check_object_creation_err(self): with patch('gluster.swift.common.constraints.__check_object_creation', mock_check_object_creation): req = Mock() req.headers = [] self.assertTrue(cnt.gluster_check_object_creation(req, 'dir/.')) req.headers = ['x-delete-at'] self.assertTrue(cnt.gluster_check_object_creation(req, 'dir/z'))
def test_gluster_check_object_creation_err(self): with patch('gluster.swift.common.constraints.__check_object_creation', mock_check_object_creation): req = Mock() req.headers = [] self.assertTrue(cnt.gluster_check_object_creation(req, 'dir/.')) #TODO: Although we now support x-delete-at and x-delete-after, #retained this test case as we may add some other header to #unsupported list in future raise SkipTest req.headers = ['x-delete-at'] self.assertTrue(cnt.gluster_check_object_creation(req, 'dir/z'))
def test_gluster_check_object_creation(self): with patch('gluster.swift.common.constraints.__check_object_creation', mock_check_object_creation): req = Mock() req.headers = [] self.assertFalse(cnt.gluster_check_object_creation(req, 'dir/z'))
def test_gluster_check_object_creation_err(self): with patch('gluster.swift.common.constraints.__check_object_creation', mock_check_object_creation): self.assertTrue(cnt.gluster_check_object_creation(None, 'dir/.'))
def test_gluster_check_object_creation_err(self): with patch('gluster.swift.common.constraints.__check_object_creation', mock_check_object_creation): req = Mock() req.headers = [] self.assertTrue(cnt.gluster_check_object_creation(req, 'dir/.'))