~rackspace-titan/glance/glance-clear-lp766295

« back to all changes in this revision

Viewing changes to tests/unit/test_swift_store.py

  • Committer: Tarmac
  • Author(s): Eldar Nugaev
  • Date: 2011-04-13 12:57:52 UTC
  • mfrom: (107.4.1 trunk)
  • Revision ID: tarmac-20110413125752-xmsxun5yurdkr2ec
Fix logging in swift

Show diffs side-by-side

added added

removed removed

Lines of Context:
324
324
                          SwiftBackend.add,
325
325
                          2, image_swift, SWIFT_OPTIONS)
326
326
 
 
327
    def test_add_no_user(self):
 
328
        """
 
329
        Tests that adding options without user raises
 
330
        an appropriate exception
 
331
        """
 
332
        image_swift = StringIO.StringIO("nevergonnamakeit")
 
333
        options = SWIFT_OPTIONS.copy()
 
334
        del options['swift_store_user']
 
335
        self.assertRaises(BackendException,
 
336
                          SwiftBackend.add,
 
337
                          2, image_swift, options)
 
338
 
 
339
    def test_no_key(self):
 
340
        """
 
341
        Tests that adding options without key raises
 
342
        an appropriate exception
 
343
        """
 
344
        image_swift = StringIO.StringIO("nevergonnamakeit")
 
345
        options = SWIFT_OPTIONS.copy()
 
346
        del options['swift_store_key']
 
347
        self.assertRaises(BackendException,
 
348
                          SwiftBackend.add,
 
349
                          2, image_swift, options)
 
350
 
 
351
    def test_add_no_auth_address(self):
 
352
        """
 
353
        Tests that adding options without auth address raises
 
354
        an appropriate exception
 
355
        """
 
356
        image_swift = StringIO.StringIO("nevergonnamakeit")
 
357
        options = SWIFT_OPTIONS.copy()
 
358
        del options['swift_store_auth_address']
 
359
        self.assertRaises(BackendException,
 
360
                          SwiftBackend.add,
 
361
                          2, image_swift, options)
 
362
 
327
363
    def test_delete(self):
328
364
        """
329
365
        Test we can delete an existing image in the swift store