コード例 #1
0
ファイル: storage.py プロジェクト: blowmage/gcloud-python
    def test_get_buckets(self):
        buckets_to_create = [
            'new%d' % (1000 * time.time(),),
            'newer%d' % (1000 * time.time(),),
            'newest%d' % (1000 * time.time(),),
        ]
        created_buckets = []
        for bucket_name in buckets_to_create:
            bucket = storage.create_bucket(bucket_name)
            self.case_buckets_to_delete.append(bucket_name)

        # Retrieve the buckets.
        all_buckets = storage.list_buckets()
        created_buckets = [bucket for bucket in all_buckets
                           if bucket.name in buckets_to_create]
        self.assertEqual(len(created_buckets), len(buckets_to_create))
コード例 #2
0
    def test_get_buckets(self):
        buckets_to_create = [
            'new%d' % (1000 * time.time(),),
            'newer%d' % (1000 * time.time(),),
            'newest%d' % (1000 * time.time(),),
        ]
        created_buckets = []
        for bucket_name in buckets_to_create:
            bucket = storage.create_bucket(bucket_name)
            self.case_buckets_to_delete.append(bucket_name)

        # Retrieve the buckets.
        all_buckets = storage.list_buckets()
        created_buckets = [bucket for bucket in all_buckets
                           if bucket.name in buckets_to_create]
        self.assertEqual(len(created_buckets), len(buckets_to_create))
コード例 #3
0
ファイル: __init__.py プロジェクト: pallav17/gcloud-python
def list_buckets(connection):
    return list(storage.list_buckets(project=PROJECT_ID,
                                     connection=connection))
コード例 #4
0
ファイル: __init__.py プロジェクト: SimKennedy/gcloud-python
def list_buckets(connection):
    return list(storage.list_buckets(project=PROJECT_ID,
                                     connection=connection))