1+ # -*- coding: utf-8 -*-
2+ #
3+ # Copyright 2023 Google LLC
4+ #
5+ # Licensed under the Apache License, Version 2.0 (the "License");
6+ # you may not use this file except in compliance with the License.
7+ # You may obtain a copy of the License at
8+ #
9+ # https://www.apache.org/licenses/LICENSE-2.0
10+ #
11+ # Unless required by applicable law or agreed to in writing, software
12+ # distributed under the License is distributed on an "AS IS" BASIS,
13+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+ # See the License for the specific language governing permissions and
15+ # limitations under the License.
16+ import os
17+
18+ import pytest
19+
20+ from google .cloud import automl_v1
21+
22+
23+ @pytest .fixture (scope = "session" )
24+ def project_id ():
25+ return os .environ ["PROJECT_ID" ]
26+
27+
28+ @pytest .mark .parametrize ("transport" , ["grpc" , "rest" ])
29+ def test_list_models (project_id : str , transport : str ):
30+ client = automl_v1 .AutoMlClient (transport = transport )
31+
32+ parent = client .common_location_path (project_id , location = "us-central1" )
33+ client .list_models (parent = parent )
34+
35+ # The purpose of this smoke test is to test the communication with the API server,
36+ # rather than API-specific functionality.
37+ # If the smoke test fails, we won't reach this line.
38+ assert True
0 commit comments