# Path: google/cloud/orchestration/airflow/service_v1/services/image_versions/pagers.py
# class ListImageVersionsPager:
# class ListImageVersionsAsyncPager:
#     def __init__(
#         self,
#         method: Callable[..., image_versions.ListImageVersionsResponse],
#         request: image_versions.ListImageVersionsRequest,
#         response: image_versions.ListImageVersionsResponse,
#         *,
#         metadata: Sequence[Tuple[str, str]] = ()
#     ):
#     def __getattr__(self, name: str) -> Any:
#     def pages(self) -> Iterator[image_versions.ListImageVersionsResponse]:
#     def __iter__(self) -> Iterator[image_versions.ImageVersion]:
#     def __repr__(self) -> str:
#     def __init__(
#         self,
#         method: Callable[..., Awaitable[image_versions.ListImageVersionsResponse]],
#         request: image_versions.ListImageVersionsRequest,
#         response: image_versions.ListImageVersionsResponse,
#         *,
#         metadata: Sequence[Tuple[str, str]] = ()
#     ):
#     def __getattr__(self, name: str) -> Any:
#     async def pages(self) -> AsyncIterator[image_versions.ListImageVersionsResponse]:
#     def __aiter__(self) -> AsyncIterator[image_versions.ImageVersion]:
#         async def async_generator():
#     def __repr__(self) -> str:
# 
# Path: google/cloud/orchestration/airflow/service_v1/types/image_versions.py
# class ListImageVersionsRequest(proto.Message):
# class ListImageVersionsResponse(proto.Message):
# class ImageVersion(proto.Message):
#     def raw_page(self):


import os
import mock
import grpc
import math
import pytest
import google.auth
from grpc.experimental import aio
from proto.marshal.rules.dates import DurationRule, TimestampRule
from google.api_core import client_options
from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
from google.api_core import grpc_helpers
from google.api_core import grpc_helpers_async
from google.api_core import path_template
from google.auth import credentials as ga_credentials
from google.auth.exceptions import MutualTLSChannelError
from google.cloud.orchestration.airflow.service_v1.services.image_versions import (
    ImageVersionsAsyncClient,
)
from google.cloud.orchestration.airflow.service_v1.services.image_versions import (
    ImageVersionsClient,
)
from google.cloud.orchestration.airflow.service_v1.services.image_versions import pagers
from google.cloud.orchestration.airflow.service_v1.services.image_versions import (
    transports,
)
from google.cloud.orchestration.airflow.service_v1.types import image_versions
from google.oauth2 import service_account
async def test_list_image_versions_async(
    transport: str = "grpc_asyncio",
    request_type=image_versions.ListImageVersionsRequest,
):
    client = ImageVersionsAsyncClient(
        credentials=ga_credentials.AnonymousCredentials(), transport=transport,
    )

    # Everything is optional in proto3 as far as the runtime is concerned,
    # and we are mocking out the actual API, so just send an empty request.
    request = request_type()

    # Mock the actual call within the gRPC stub, and fake the request.
    with mock.patch.object(
        type(client.transport.list_image_versions), "__call__"
    ) as call:
        # Designate an appropriate return value for the call.
        call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(
            image_versions.ListImageVersionsResponse(
                next_page_token="next_page_token_value",
            )
        )
        response = await client.list_image_versions(request)

        # Establish that the underlying gRPC stub method was called.
        assert len(call.mock_calls)
        _, args, _ = call.mock_calls[0]
        assert args[0] == image_versions.ListImageVersionsRequest()

    # Establish that the response is the type that we expect.

# Path: google/cloud/orchestration/airflow/service_v1/services/image_versions/pagers.py
# class ListImageVersionsPager:
# class ListImageVersionsAsyncPager:
#     def __init__(
#         self,
#         method: Callable[..., image_versions.ListImageVersionsResponse],
#         request: image_versions.ListImageVersionsRequest,
#         response: image_versions.ListImageVersionsResponse,
#         *,
#         metadata: Sequence[Tuple[str, str]] = ()
#     ):
#     def __getattr__(self, name: str) -> Any:
#     def pages(self) -> Iterator[image_versions.ListImageVersionsResponse]:
#     def __iter__(self) -> Iterator[image_versions.ImageVersion]:
#     def __repr__(self) -> str:
#     def __init__(
#         self,
#         method: Callable[..., Awaitable[image_versions.ListImageVersionsResponse]],
#         request: image_versions.ListImageVersionsRequest,
#         response: image_versions.ListImageVersionsResponse,
#         *,
#         metadata: Sequence[Tuple[str, str]] = ()
#     ):
#     def __getattr__(self, name: str) -> Any:
#     async def pages(self) -> AsyncIterator[image_versions.ListImageVersionsResponse]:
#     def __aiter__(self) -> AsyncIterator[image_versions.ImageVersion]:
#         async def async_generator():
#     def __repr__(self) -> str:
# 
# Path: google/cloud/orchestration/airflow/service_v1/types/image_versions.py
# class ListImageVersionsRequest(proto.Message):
# class ListImageVersionsResponse(proto.Message):
# class ImageVersion(proto.Message):
#     def raw_page(self):


# Path: tests/unit/gapic/service_v1/test_image_versions.py
import os
import mock
import grpc
import math
import pytest
import google.auth
from grpc.experimental import aio
from proto.marshal.rules.dates import DurationRule, TimestampRule
from google.api_core import client_options
from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
from google.api_core import grpc_helpers
from google.api_core import grpc_helpers_async
from google.api_core import path_template
from google.auth import credentials as ga_credentials
from google.auth.exceptions import MutualTLSChannelError
from google.cloud.orchestration.airflow.service_v1.services.image_versions import (
    ImageVersionsAsyncClient,
)
from google.cloud.orchestration.airflow.service_v1.services.image_versions import (
    ImageVersionsClient,
)
from google.cloud.orchestration.airflow.service_v1.services.image_versions import pagers
from google.cloud.orchestration.airflow.service_v1.services.image_versions import (
    transports,
)
from google.cloud.orchestration.airflow.service_v1.types import image_versions
from google.oauth2 import service_account

async def test_list_image_versions_async(
    transport: str = "grpc_asyncio",
    request_type=image_versions.ListImageVersionsRequest,
):
    client = ImageVersionsAsyncClient(
        credentials=ga_credentials.AnonymousCredentials(), transport=transport,
    )

    # Everything is optional in proto3 as far as the runtime is concerned,
    # and we are mocking out the actual API, so just send an empty request.
    request = request_type()

    # Mock the actual call within the gRPC stub, and fake the request.
    with mock.patch.object(
        type(client.transport.list_image_versions), "__call__"
    ) as call:
        # Designate an appropriate return value for the call.
        call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(
            image_versions.ListImageVersionsResponse(
                next_page_token="next_page_token_value",
            )
        )
        response = await client.list_image_versions(request)

        # Establish that the underlying gRPC stub method was called.
        assert len(call.mock_calls)
        _, args, _ = call.mock_calls[0]
        assert args[0] == image_versions.ListImageVersionsRequest()

    # Establish that the response is the type that we expect.

    assert isinstance(response, pagers.ListImageVersionsAsyncPager)