Revision aa9c7402 kamaki/clients/storage/test.py

b/kamaki/clients/storage/test.py
316 316
        self.assertEqual(SH.mock_calls, exp_shd)
317 317
        self.assertEqual(put.mock_calls, exp_put)
318 318

  
319
    """
320
    def test_get_object_info(self):
319
    @patch('%s.head' % storage_pkg, return_value=FR())
320
    def test_get_object_info(self, head):
321 321
        FR.headers = object_info
322
        version = 'v3r510n'
323
        with patch.object(PC, 'object_head', return_value=FR()) as head:
324
            r = self.client.get_object_info(obj)
325
            self.assertEqual(r, object_info)
326
            r = self.client.get_object_info(obj, version=version)
327
            self.assertEqual(head.mock_calls, [
328
                call(obj, version=None),
329
                call(obj, version=version)])
330
        with patch.object(
331
                PC,
332
                'object_head',
333
                side_effect=ClientError('Obj not found', 404)):
334
            self.assertRaises(
335
                ClientError,
336
                self.client.get_object_info,
337
                obj, version=version)
322
        path = '/%s/%s/%s' % (self.client.account, self.client.container, obj)
323
        r = self.client.get_object_info(obj)
324
        self.assertEqual(r, object_info)
325
        self.assertEqual(head.mock_calls[-1], call(path, success=200))
338 326

  
327
    """
339 328
    @patch('%s.get_object_info' % pithos_pkg, return_value=object_info)
340 329
    def test_get_object_meta(self, GOI):
341 330
        expected = dict()

Also available in: Unified diff