# Path: pandas_gbq/auth.py
# CREDENTIALS_CACHE_DIRNAME = "pandas_gbq"
# CREDENTIALS_CACHE_FILENAME = "bigquery_credentials.dat"
# SCOPES = ["https://www.googleapis.com/auth/bigquery"]
# CLIENT_ID = "725825577420-unm2gnkiprugilg743tkbig250f4sfsj.apps.googleusercontent.com"
# CLIENT_SECRET = "4hqze9yI8fxShls8eJWkeMdJ"
# def get_credentials(
#     private_key=None, project_id=None, reauth=False, auth_local_webserver=False
# ):
# def get_credentials_cache(reauth):


import os
import pytest
    import google.auth
    import google.auth
    import google.auth
from unittest import mock
from pandas_gbq import auth
    from google.auth.credentials import Credentials
def mock_default_credentials(scopes=None, request=None):
    return (None, None)


def test_should_be_able_to_get_valid_credentials(project_id):
    credentials, _ = auth.get_credentials(project_id=project_id)
    assert credentials.valid


@pytest.mark.skipif(
    IS_RUNNING_ON_CI, reason="end-user auth requires human intervention"
)
def test_get_credentials_bad_file_returns_user_credentials(project_id, monkeypatch):

    monkeypatch.setattr(google.auth, "default", mock_default_credentials)

    with mock.patch("__main__.open", side_effect=IOError()):
        credentials, _ = auth.get_credentials(
            project_id=project_id, auth_local_webserver=True
        )
    assert isinstance(credentials, Credentials)


@pytest.mark.skipif(
    IS_RUNNING_ON_CI, reason="end-user auth requires human intervention"
)
def test_get_credentials_user_credentials_with_reauth(project_id, monkeypatch):

    monkeypatch.setattr(google.auth, "default", mock_default_credentials)


# Path: pandas_gbq/auth.py
# CREDENTIALS_CACHE_DIRNAME = "pandas_gbq"
# CREDENTIALS_CACHE_FILENAME = "bigquery_credentials.dat"
# SCOPES = ["https://www.googleapis.com/auth/bigquery"]
# CLIENT_ID = "725825577420-unm2gnkiprugilg743tkbig250f4sfsj.apps.googleusercontent.com"
# CLIENT_SECRET = "4hqze9yI8fxShls8eJWkeMdJ"
# def get_credentials(
#     private_key=None, project_id=None, reauth=False, auth_local_webserver=False
# ):
# def get_credentials_cache(reauth):


# Path: tests/system/test_auth.py
import os
import pytest
    import google.auth
    import google.auth
    import google.auth
from unittest import mock
from pandas_gbq import auth
    from google.auth.credentials import Credentials

def mock_default_credentials(scopes=None, request=None):
    return (None, None)


def test_should_be_able_to_get_valid_credentials(project_id):
    credentials, _ = auth.get_credentials(project_id=project_id)
    assert credentials.valid


@pytest.mark.skipif(
    IS_RUNNING_ON_CI, reason="end-user auth requires human intervention"
)
def test_get_credentials_bad_file_returns_user_credentials(project_id, monkeypatch):

    monkeypatch.setattr(google.auth, "default", mock_default_credentials)

    with mock.patch("__main__.open", side_effect=IOError()):
        credentials, _ = auth.get_credentials(
            project_id=project_id, auth_local_webserver=True
        )
    assert isinstance(credentials, Credentials)


@pytest.mark.skipif(
    IS_RUNNING_ON_CI, reason="end-user auth requires human intervention"
)
def test_get_credentials_user_credentials_with_reauth(project_id, monkeypatch):

    monkeypatch.setattr(google.auth, "default", mock_default_credentials)


    credentials, _ = auth.get_credentials(