Exemple #1
0
 def setUp(self):
     if Application is None:
         raise SkipTest
     self.client = Client(retries=1, swift_proxy=True,
                          swift_proxy_storage_path=SWIFT_PROXY_STORAGE_PATH)
     self.uuid = uuid4().hex
     self.container = 'swiftly_test_' + self.uuid
     status = self.client.put_container(self.container)[0]
     self.assertTrue(status // 100 == 2)
Exemple #2
0
 def setUp(self):
     self.client = Client(AUTH_URL, AUTH_USER, AUTH_KEY)
     self.uuid = uuid4().hex
     self.container = 'swiftly_test_' + self.uuid
     status = self.client.put_container(self.container)[0]
     self.assertTrue(status // 100 == 2)
     status = \
         self.client.put_object(self.container, 'object1', '123456789')[0]
     self.assertTrue(status // 100 == 2)
 def test_head_bad_auth(self):
     self.client = Client(AUTH_URL,
                          AUTH_USER,
                          AUTH_KEY + 'invalid',
                          retries=0)
     exc = None
     try:
         self.client.head_account()
     except HTTPException, err:
         exc = err
Exemple #4
0
 def open(self):
     self.client = Client(
         auth_url,
         auth_user,
         auth_key,
         proxy=proxy,
         retries=retries,
         swift_proxy=swift_proxy,
         cache_path=cache_path,
     )
     try:
         (status, reason, headers, contents) = \
             __swiftly_client.head_account()
     except:
         self.logger.error('Connection failed: connection refused.')
         return False
     if status != 200:
         self.logger.error('Connection failed: (%d) %s' % (status, reason))
         return False
     self.logger.debug('Connection made to swift.')
     return True
 def setUp(self):
     if Application is None:
         raise SkipTest
     self.client = Client(retries=1,
                          swift_proxy=True,
                          swift_proxy_storage_path=SWIFT_PROXY_STORAGE_PATH)
 def setUp(self):
     self.client = Client(AUTH_URL, AUTH_USER, AUTH_KEY, retries=1)