# Path: firebase_admin/credentials.py
# class Base:
# class Certificate(Base):
# class ApplicationDefault(Base):
# class RefreshToken(Base):
#     def get_access_token(self):
#     def get_credential(self):
#     def __init__(self, cert):
#     def project_id(self):
#     def signer(self):
#     def service_account_email(self):
#     def get_credential(self):
#     def __init__(self):
#     def get_credential(self):
#     def project_id(self):
#     def _load_credential(self):
#     def __init__(self, refresh_token):
#     def client_id(self):
#     def client_secret(self):
#     def refresh_token(self):
#     def get_credential(self):
# def _is_file_path(path):
#     _CREDENTIAL_TYPE = 'service_account'
#     _CREDENTIAL_TYPE = 'authorized_user'
# 
# Path: firebase_admin/storage.py
# _STORAGE_ATTRIBUTE = '_storage'
# def bucket(name=None, app=None) -> storage.Bucket:
#     def __init__(self, credentials, project, default_bucket):
#     def from_app(cls, app):
#     def bucket(self, name=None):
# class _StorageClient:
# 
# Path: tests/testutils.py
# def resource_filename(filename):
# def resource(filename):
# def cleanup_apps():
# def run_without_project_id(func):
# def new_monkeypatch():
#     def __init__(self, status, response):
#     def status(self):
#     def headers(self):
#     def data(self):
#     def __init__(self, status, response):
#     def __call__(self, *args, **kwargs): # pylint: disable=arguments-differ
#     def __init__(self, error):
#     def __call__(self, *args, **kwargs): # pylint: disable=arguments-differ
#     def refresh(self, request):
#     def __init__(self):
#     def get_credential(self):
#     def __init__(self, responses, statuses, recorder):
#     def send(self, request, **kwargs): # pylint: disable=arguments-differ
#     def __init__(self, data, status, recorder):
#     def status(self):
#     def data(self):
# class MockResponse(transport.Response):
# class MockRequest(transport.Request):
# class MockFailedRequest(transport.Request):
# class MockGoogleCredential(credentials.Credentials):
# class MockCredential(firebase_admin.credentials.Base):
# class MockMultiRequestAdapter(adapters.HTTPAdapter):
# class MockAdapter(MockMultiRequestAdapter):


import pytest
import firebase_admin
from firebase_admin import credentials
from firebase_admin import storage
from tests import testutils
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Tests for firebase_admin.storage."""




def setup_module():
    cred = credentials.Certificate(testutils.resource_filename('service_account.json'))
    firebase_admin.initialize_app(cred)

def teardown_module():
    testutils.cleanup_apps()

def test_invalid_config():
    with pytest.raises(ValueError):
        storage.bucket()

@pytest.mark.parametrize('name', [None, '', 0, 1, True, False, list(), tuple(), dict()])
def test_invalid_name(name):
    with pytest.raises(ValueError):

# Path: firebase_admin/credentials.py
# class Base:
# class Certificate(Base):
# class ApplicationDefault(Base):
# class RefreshToken(Base):
#     def get_access_token(self):
#     def get_credential(self):
#     def __init__(self, cert):
#     def project_id(self):
#     def signer(self):
#     def service_account_email(self):
#     def get_credential(self):
#     def __init__(self):
#     def get_credential(self):
#     def project_id(self):
#     def _load_credential(self):
#     def __init__(self, refresh_token):
#     def client_id(self):
#     def client_secret(self):
#     def refresh_token(self):
#     def get_credential(self):
# def _is_file_path(path):
#     _CREDENTIAL_TYPE = 'service_account'
#     _CREDENTIAL_TYPE = 'authorized_user'
# 
# Path: firebase_admin/storage.py
# _STORAGE_ATTRIBUTE = '_storage'
# def bucket(name=None, app=None) -> storage.Bucket:
#     def __init__(self, credentials, project, default_bucket):
#     def from_app(cls, app):
#     def bucket(self, name=None):
# class _StorageClient:
# 
# Path: tests/testutils.py
# def resource_filename(filename):
# def resource(filename):
# def cleanup_apps():
# def run_without_project_id(func):
# def new_monkeypatch():
#     def __init__(self, status, response):
#     def status(self):
#     def headers(self):
#     def data(self):
#     def __init__(self, status, response):
#     def __call__(self, *args, **kwargs): # pylint: disable=arguments-differ
#     def __init__(self, error):
#     def __call__(self, *args, **kwargs): # pylint: disable=arguments-differ
#     def refresh(self, request):
#     def __init__(self):
#     def get_credential(self):
#     def __init__(self, responses, statuses, recorder):
#     def send(self, request, **kwargs): # pylint: disable=arguments-differ
#     def __init__(self, data, status, recorder):
#     def status(self):
#     def data(self):
# class MockResponse(transport.Response):
# class MockRequest(transport.Request):
# class MockFailedRequest(transport.Request):
# class MockGoogleCredential(credentials.Credentials):
# class MockCredential(firebase_admin.credentials.Base):
# class MockMultiRequestAdapter(adapters.HTTPAdapter):
# class MockAdapter(MockMultiRequestAdapter):


# Path: tests/test_storage.py
import pytest
import firebase_admin
from firebase_admin import credentials
from firebase_admin import storage
from tests import testutils

# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Tests for firebase_admin.storage."""




def setup_module():
    cred = credentials.Certificate(testutils.resource_filename('service_account.json'))
    firebase_admin.initialize_app(cred)

def teardown_module():
    testutils.cleanup_apps()

def test_invalid_config():
    with pytest.raises(ValueError):
        storage.bucket()

@pytest.mark.parametrize('name', [None, '', 0, 1, True, False, list(), tuple(), dict()])
def test_invalid_name(name):
    with pytest.raises(ValueError):

        storage.bucket(name)