# Path: google/api_core/client_options.py
# class ClientOptions(object):
#     def __init__(
#         self,
#         api_endpoint=None,
#         client_cert_source=None,
#         client_encrypted_cert_source=None,
#         quota_project_id=None,
#         credentials_file=None,
#         scopes=None,
#         api_key=None,
#     ):
#     def __repr__(self):
# def from_dict(options):


import pytest
from google.api_core import client_options
        )


def test_from_dict():
    options = client_options.from_dict(
        {
            "api_endpoint": "foo.googleapis.com",
            "client_cert_source": get_client_cert,
            "quota_project_id": "quote-proj",
            "credentials_file": "path/to/credentials.json",
            "scopes": [
                "https://www.googleapis.com/auth/cloud-platform",
                "https://www.googleapis.com/auth/cloud-platform.read-only",
            ],
        }
    )

    assert options.api_endpoint == "foo.googleapis.com"
    assert options.client_cert_source() == (b"cert", b"key")
    assert options.quota_project_id == "quote-proj"
    assert options.credentials_file == "path/to/credentials.json"
    assert options.scopes == [
        "https://www.googleapis.com/auth/cloud-platform",
        "https://www.googleapis.com/auth/cloud-platform.read-only",
    ]
    assert options.api_key is None


def test_from_dict_bad_argument():
    with pytest.raises(ValueError):

# Path: google/api_core/client_options.py
# class ClientOptions(object):
#     def __init__(
#         self,
#         api_endpoint=None,
#         client_cert_source=None,
#         client_encrypted_cert_source=None,
#         quota_project_id=None,
#         credentials_file=None,
#         scopes=None,
#         api_key=None,
#     ):
#     def __repr__(self):
# def from_dict(options):


# Path: tests/unit/test_client_options.py
import pytest
from google.api_core import client_options

        )


def test_from_dict():
    options = client_options.from_dict(
        {
            "api_endpoint": "foo.googleapis.com",
            "client_cert_source": get_client_cert,
            "quota_project_id": "quote-proj",
            "credentials_file": "path/to/credentials.json",
            "scopes": [
                "https://www.googleapis.com/auth/cloud-platform",
                "https://www.googleapis.com/auth/cloud-platform.read-only",
            ],
        }
    )

    assert options.api_endpoint == "foo.googleapis.com"
    assert options.client_cert_source() == (b"cert", b"key")
    assert options.quota_project_id == "quote-proj"
    assert options.credentials_file == "path/to/credentials.json"
    assert options.scopes == [
        "https://www.googleapis.com/auth/cloud-platform",
        "https://www.googleapis.com/auth/cloud-platform.read-only",
    ]
    assert options.api_key is None


def test_from_dict_bad_argument():
    with pytest.raises(ValueError):

        client_options.from_dict(