def test_with_existing_locked_upload_area__raises(self): db_area = self.create_upload_area() area = UploadArea(db_area.uuid) area.lock() with self.assertRaises(UploadException): area.credentials()
def test_with_existing_unlocked_upload_area__returns_creds(self): db_area = self.create_upload_area() area = UploadArea(db_area.uuid) creds = area.credentials() keys = list(creds.keys()) keys.sort() self.assertEqual( ['AccessKeyId', 'Expiration', 'SecretAccessKey', 'SessionToken'], keys)
def test_with_deleted_upload_area__raises(self): db_area = self.create_upload_area(status='DELETED') with self.assertRaises(UploadException): area = UploadArea(db_area.uuid) area.credentials()