google-analytics-admin 0.23.1__tar.gz → 0.23.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {google_analytics_admin-0.23.1/google_analytics_admin.egg-info → google_analytics_admin-0.23.2}/PKG-INFO +1 -1
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin/gapic_version.py +1 -1
- {google_analytics_admin-0.23.1/google/analytics/admin_v1beta → google_analytics_admin-0.23.2/google/analytics/admin_v1alpha}/gapic_version.py +1 -1
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1alpha/services/analytics_admin_service/client.py +3 -37
- {google_analytics_admin-0.23.1/google/analytics/admin_v1alpha → google_analytics_admin-0.23.2/google/analytics/admin_v1beta}/gapic_version.py +1 -1
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1beta/services/analytics_admin_service/client.py +3 -37
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2/google_analytics_admin.egg-info}/PKG-INFO +1 -1
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/tests/unit/gapic/admin_v1alpha/test_analytics_admin_service.py +0 -88
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/tests/unit/gapic/admin_v1beta/test_analytics_admin_service.py +0 -88
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/LICENSE +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/MANIFEST.in +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/README.rst +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin/__init__.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin/py.typed +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1alpha/__init__.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1alpha/gapic_metadata.json +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1alpha/py.typed +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1alpha/services/__init__.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1alpha/services/analytics_admin_service/__init__.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1alpha/services/analytics_admin_service/async_client.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1alpha/services/analytics_admin_service/pagers.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1alpha/services/analytics_admin_service/transports/__init__.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1alpha/services/analytics_admin_service/transports/base.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1alpha/services/analytics_admin_service/transports/grpc.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1alpha/services/analytics_admin_service/transports/grpc_asyncio.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1alpha/services/analytics_admin_service/transports/rest.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1alpha/services/analytics_admin_service/transports/rest_base.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1alpha/types/__init__.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1alpha/types/access_report.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1alpha/types/analytics_admin.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1alpha/types/audience.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1alpha/types/channel_group.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1alpha/types/event_create_and_edit.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1alpha/types/expanded_data_set.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1alpha/types/resources.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1alpha/types/subproperty_event_filter.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1beta/__init__.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1beta/gapic_metadata.json +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1beta/py.typed +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1beta/services/__init__.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1beta/services/analytics_admin_service/__init__.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1beta/services/analytics_admin_service/async_client.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1beta/services/analytics_admin_service/pagers.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1beta/services/analytics_admin_service/transports/__init__.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1beta/services/analytics_admin_service/transports/base.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1beta/services/analytics_admin_service/transports/grpc.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1beta/services/analytics_admin_service/transports/grpc_asyncio.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1beta/services/analytics_admin_service/transports/rest.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1beta/services/analytics_admin_service/transports/rest_base.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1beta/types/__init__.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1beta/types/access_report.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1beta/types/analytics_admin.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin_v1beta/types/resources.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google_analytics_admin.egg-info/SOURCES.txt +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google_analytics_admin.egg-info/dependency_links.txt +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google_analytics_admin.egg-info/not-zip-safe +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google_analytics_admin.egg-info/requires.txt +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google_analytics_admin.egg-info/top_level.txt +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/setup.cfg +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/setup.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/tests/__init__.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/tests/unit/__init__.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/tests/unit/gapic/__init__.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/tests/unit/gapic/admin_v1alpha/__init__.py +0 -0
- {google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/tests/unit/gapic/admin_v1beta/__init__.py +0 -0
|
@@ -1100,36 +1100,6 @@ class AnalyticsAdminServiceClient(metaclass=AnalyticsAdminServiceClientMeta):
|
|
|
1100
1100
|
raise ValueError("Universe Domain cannot be an empty string.")
|
|
1101
1101
|
return universe_domain
|
|
1102
1102
|
|
|
1103
|
-
@staticmethod
|
|
1104
|
-
def _compare_universes(
|
|
1105
|
-
client_universe: str, credentials: ga_credentials.Credentials
|
|
1106
|
-
) -> bool:
|
|
1107
|
-
"""Returns True iff the universe domains used by the client and credentials match.
|
|
1108
|
-
|
|
1109
|
-
Args:
|
|
1110
|
-
client_universe (str): The universe domain configured via the client options.
|
|
1111
|
-
credentials (ga_credentials.Credentials): The credentials being used in the client.
|
|
1112
|
-
|
|
1113
|
-
Returns:
|
|
1114
|
-
bool: True iff client_universe matches the universe in credentials.
|
|
1115
|
-
|
|
1116
|
-
Raises:
|
|
1117
|
-
ValueError: when client_universe does not match the universe in credentials.
|
|
1118
|
-
"""
|
|
1119
|
-
|
|
1120
|
-
default_universe = AnalyticsAdminServiceClient._DEFAULT_UNIVERSE
|
|
1121
|
-
credentials_universe = getattr(credentials, "universe_domain", default_universe)
|
|
1122
|
-
|
|
1123
|
-
if client_universe != credentials_universe:
|
|
1124
|
-
raise ValueError(
|
|
1125
|
-
"The configured universe domain "
|
|
1126
|
-
f"({client_universe}) does not match the universe domain "
|
|
1127
|
-
f"found in the credentials ({credentials_universe}). "
|
|
1128
|
-
"If you haven't configured the universe domain explicitly, "
|
|
1129
|
-
f"`{default_universe}` is the default."
|
|
1130
|
-
)
|
|
1131
|
-
return True
|
|
1132
|
-
|
|
1133
1103
|
def _validate_universe_domain(self):
|
|
1134
1104
|
"""Validates client's and credentials' universe domains are consistent.
|
|
1135
1105
|
|
|
@@ -1139,13 +1109,9 @@ class AnalyticsAdminServiceClient(metaclass=AnalyticsAdminServiceClientMeta):
|
|
|
1139
1109
|
Raises:
|
|
1140
1110
|
ValueError: If the configured universe domain is not valid.
|
|
1141
1111
|
"""
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
self.universe_domain, self.transport._credentials
|
|
1146
|
-
)
|
|
1147
|
-
)
|
|
1148
|
-
return self._is_universe_domain_valid
|
|
1112
|
+
|
|
1113
|
+
# NOTE (b/349488459): universe validation is disabled until further notice.
|
|
1114
|
+
return True
|
|
1149
1115
|
|
|
1150
1116
|
@property
|
|
1151
1117
|
def api_endpoint(self):
|
|
@@ -697,36 +697,6 @@ class AnalyticsAdminServiceClient(metaclass=AnalyticsAdminServiceClientMeta):
|
|
|
697
697
|
raise ValueError("Universe Domain cannot be an empty string.")
|
|
698
698
|
return universe_domain
|
|
699
699
|
|
|
700
|
-
@staticmethod
|
|
701
|
-
def _compare_universes(
|
|
702
|
-
client_universe: str, credentials: ga_credentials.Credentials
|
|
703
|
-
) -> bool:
|
|
704
|
-
"""Returns True iff the universe domains used by the client and credentials match.
|
|
705
|
-
|
|
706
|
-
Args:
|
|
707
|
-
client_universe (str): The universe domain configured via the client options.
|
|
708
|
-
credentials (ga_credentials.Credentials): The credentials being used in the client.
|
|
709
|
-
|
|
710
|
-
Returns:
|
|
711
|
-
bool: True iff client_universe matches the universe in credentials.
|
|
712
|
-
|
|
713
|
-
Raises:
|
|
714
|
-
ValueError: when client_universe does not match the universe in credentials.
|
|
715
|
-
"""
|
|
716
|
-
|
|
717
|
-
default_universe = AnalyticsAdminServiceClient._DEFAULT_UNIVERSE
|
|
718
|
-
credentials_universe = getattr(credentials, "universe_domain", default_universe)
|
|
719
|
-
|
|
720
|
-
if client_universe != credentials_universe:
|
|
721
|
-
raise ValueError(
|
|
722
|
-
"The configured universe domain "
|
|
723
|
-
f"({client_universe}) does not match the universe domain "
|
|
724
|
-
f"found in the credentials ({credentials_universe}). "
|
|
725
|
-
"If you haven't configured the universe domain explicitly, "
|
|
726
|
-
f"`{default_universe}` is the default."
|
|
727
|
-
)
|
|
728
|
-
return True
|
|
729
|
-
|
|
730
700
|
def _validate_universe_domain(self):
|
|
731
701
|
"""Validates client's and credentials' universe domains are consistent.
|
|
732
702
|
|
|
@@ -736,13 +706,9 @@ class AnalyticsAdminServiceClient(metaclass=AnalyticsAdminServiceClientMeta):
|
|
|
736
706
|
Raises:
|
|
737
707
|
ValueError: If the configured universe domain is not valid.
|
|
738
708
|
"""
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
self.universe_domain, self.transport._credentials
|
|
743
|
-
)
|
|
744
|
-
)
|
|
745
|
-
return self._is_universe_domain_valid
|
|
709
|
+
|
|
710
|
+
# NOTE (b/349488459): universe validation is disabled until further notice.
|
|
711
|
+
return True
|
|
746
712
|
|
|
747
713
|
@property
|
|
748
714
|
def api_endpoint(self):
|
|
@@ -353,94 +353,6 @@ def test__get_universe_domain():
|
|
|
353
353
|
assert str(excinfo.value) == "Universe Domain cannot be an empty string."
|
|
354
354
|
|
|
355
355
|
|
|
356
|
-
@pytest.mark.parametrize(
|
|
357
|
-
"client_class,transport_class,transport_name",
|
|
358
|
-
[
|
|
359
|
-
(
|
|
360
|
-
AnalyticsAdminServiceClient,
|
|
361
|
-
transports.AnalyticsAdminServiceGrpcTransport,
|
|
362
|
-
"grpc",
|
|
363
|
-
),
|
|
364
|
-
(
|
|
365
|
-
AnalyticsAdminServiceClient,
|
|
366
|
-
transports.AnalyticsAdminServiceRestTransport,
|
|
367
|
-
"rest",
|
|
368
|
-
),
|
|
369
|
-
],
|
|
370
|
-
)
|
|
371
|
-
def test__validate_universe_domain(client_class, transport_class, transport_name):
|
|
372
|
-
client = client_class(
|
|
373
|
-
transport=transport_class(credentials=ga_credentials.AnonymousCredentials())
|
|
374
|
-
)
|
|
375
|
-
assert client._validate_universe_domain() == True
|
|
376
|
-
|
|
377
|
-
# Test the case when universe is already validated.
|
|
378
|
-
assert client._validate_universe_domain() == True
|
|
379
|
-
|
|
380
|
-
if transport_name == "grpc":
|
|
381
|
-
# Test the case where credentials are provided by the
|
|
382
|
-
# `local_channel_credentials`. The default universes in both match.
|
|
383
|
-
channel = grpc.secure_channel(
|
|
384
|
-
"http://localhost/", grpc.local_channel_credentials()
|
|
385
|
-
)
|
|
386
|
-
client = client_class(transport=transport_class(channel=channel))
|
|
387
|
-
assert client._validate_universe_domain() == True
|
|
388
|
-
|
|
389
|
-
# Test the case where credentials do not exist: e.g. a transport is provided
|
|
390
|
-
# with no credentials. Validation should still succeed because there is no
|
|
391
|
-
# mismatch with non-existent credentials.
|
|
392
|
-
channel = grpc.secure_channel(
|
|
393
|
-
"http://localhost/", grpc.local_channel_credentials()
|
|
394
|
-
)
|
|
395
|
-
transport = transport_class(channel=channel)
|
|
396
|
-
transport._credentials = None
|
|
397
|
-
client = client_class(transport=transport)
|
|
398
|
-
assert client._validate_universe_domain() == True
|
|
399
|
-
|
|
400
|
-
# TODO: This is needed to cater for older versions of google-auth
|
|
401
|
-
# Make this test unconditional once the minimum supported version of
|
|
402
|
-
# google-auth becomes 2.23.0 or higher.
|
|
403
|
-
google_auth_major, google_auth_minor = [
|
|
404
|
-
int(part) for part in google.auth.__version__.split(".")[0:2]
|
|
405
|
-
]
|
|
406
|
-
if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23):
|
|
407
|
-
credentials = ga_credentials.AnonymousCredentials()
|
|
408
|
-
credentials._universe_domain = "foo.com"
|
|
409
|
-
# Test the case when there is a universe mismatch from the credentials.
|
|
410
|
-
client = client_class(transport=transport_class(credentials=credentials))
|
|
411
|
-
with pytest.raises(ValueError) as excinfo:
|
|
412
|
-
client._validate_universe_domain()
|
|
413
|
-
assert (
|
|
414
|
-
str(excinfo.value)
|
|
415
|
-
== "The configured universe domain (googleapis.com) does not match the universe domain found in the credentials (foo.com). If you haven't configured the universe domain explicitly, `googleapis.com` is the default."
|
|
416
|
-
)
|
|
417
|
-
|
|
418
|
-
# Test the case when there is a universe mismatch from the client.
|
|
419
|
-
#
|
|
420
|
-
# TODO: Make this test unconditional once the minimum supported version of
|
|
421
|
-
# google-api-core becomes 2.15.0 or higher.
|
|
422
|
-
api_core_major, api_core_minor = [
|
|
423
|
-
int(part) for part in api_core_version.__version__.split(".")[0:2]
|
|
424
|
-
]
|
|
425
|
-
if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15):
|
|
426
|
-
client = client_class(
|
|
427
|
-
client_options={"universe_domain": "bar.com"},
|
|
428
|
-
transport=transport_class(
|
|
429
|
-
credentials=ga_credentials.AnonymousCredentials(),
|
|
430
|
-
),
|
|
431
|
-
)
|
|
432
|
-
with pytest.raises(ValueError) as excinfo:
|
|
433
|
-
client._validate_universe_domain()
|
|
434
|
-
assert (
|
|
435
|
-
str(excinfo.value)
|
|
436
|
-
== "The configured universe domain (bar.com) does not match the universe domain found in the credentials (googleapis.com). If you haven't configured the universe domain explicitly, `googleapis.com` is the default."
|
|
437
|
-
)
|
|
438
|
-
|
|
439
|
-
# Test that ValueError is raised if universe_domain is provided via client options and credentials is None
|
|
440
|
-
with pytest.raises(ValueError):
|
|
441
|
-
client._compare_universes("foo.bar", None)
|
|
442
|
-
|
|
443
|
-
|
|
444
356
|
@pytest.mark.parametrize(
|
|
445
357
|
"client_class,transport_name",
|
|
446
358
|
[
|
|
@@ -342,94 +342,6 @@ def test__get_universe_domain():
|
|
|
342
342
|
assert str(excinfo.value) == "Universe Domain cannot be an empty string."
|
|
343
343
|
|
|
344
344
|
|
|
345
|
-
@pytest.mark.parametrize(
|
|
346
|
-
"client_class,transport_class,transport_name",
|
|
347
|
-
[
|
|
348
|
-
(
|
|
349
|
-
AnalyticsAdminServiceClient,
|
|
350
|
-
transports.AnalyticsAdminServiceGrpcTransport,
|
|
351
|
-
"grpc",
|
|
352
|
-
),
|
|
353
|
-
(
|
|
354
|
-
AnalyticsAdminServiceClient,
|
|
355
|
-
transports.AnalyticsAdminServiceRestTransport,
|
|
356
|
-
"rest",
|
|
357
|
-
),
|
|
358
|
-
],
|
|
359
|
-
)
|
|
360
|
-
def test__validate_universe_domain(client_class, transport_class, transport_name):
|
|
361
|
-
client = client_class(
|
|
362
|
-
transport=transport_class(credentials=ga_credentials.AnonymousCredentials())
|
|
363
|
-
)
|
|
364
|
-
assert client._validate_universe_domain() == True
|
|
365
|
-
|
|
366
|
-
# Test the case when universe is already validated.
|
|
367
|
-
assert client._validate_universe_domain() == True
|
|
368
|
-
|
|
369
|
-
if transport_name == "grpc":
|
|
370
|
-
# Test the case where credentials are provided by the
|
|
371
|
-
# `local_channel_credentials`. The default universes in both match.
|
|
372
|
-
channel = grpc.secure_channel(
|
|
373
|
-
"http://localhost/", grpc.local_channel_credentials()
|
|
374
|
-
)
|
|
375
|
-
client = client_class(transport=transport_class(channel=channel))
|
|
376
|
-
assert client._validate_universe_domain() == True
|
|
377
|
-
|
|
378
|
-
# Test the case where credentials do not exist: e.g. a transport is provided
|
|
379
|
-
# with no credentials. Validation should still succeed because there is no
|
|
380
|
-
# mismatch with non-existent credentials.
|
|
381
|
-
channel = grpc.secure_channel(
|
|
382
|
-
"http://localhost/", grpc.local_channel_credentials()
|
|
383
|
-
)
|
|
384
|
-
transport = transport_class(channel=channel)
|
|
385
|
-
transport._credentials = None
|
|
386
|
-
client = client_class(transport=transport)
|
|
387
|
-
assert client._validate_universe_domain() == True
|
|
388
|
-
|
|
389
|
-
# TODO: This is needed to cater for older versions of google-auth
|
|
390
|
-
# Make this test unconditional once the minimum supported version of
|
|
391
|
-
# google-auth becomes 2.23.0 or higher.
|
|
392
|
-
google_auth_major, google_auth_minor = [
|
|
393
|
-
int(part) for part in google.auth.__version__.split(".")[0:2]
|
|
394
|
-
]
|
|
395
|
-
if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23):
|
|
396
|
-
credentials = ga_credentials.AnonymousCredentials()
|
|
397
|
-
credentials._universe_domain = "foo.com"
|
|
398
|
-
# Test the case when there is a universe mismatch from the credentials.
|
|
399
|
-
client = client_class(transport=transport_class(credentials=credentials))
|
|
400
|
-
with pytest.raises(ValueError) as excinfo:
|
|
401
|
-
client._validate_universe_domain()
|
|
402
|
-
assert (
|
|
403
|
-
str(excinfo.value)
|
|
404
|
-
== "The configured universe domain (googleapis.com) does not match the universe domain found in the credentials (foo.com). If you haven't configured the universe domain explicitly, `googleapis.com` is the default."
|
|
405
|
-
)
|
|
406
|
-
|
|
407
|
-
# Test the case when there is a universe mismatch from the client.
|
|
408
|
-
#
|
|
409
|
-
# TODO: Make this test unconditional once the minimum supported version of
|
|
410
|
-
# google-api-core becomes 2.15.0 or higher.
|
|
411
|
-
api_core_major, api_core_minor = [
|
|
412
|
-
int(part) for part in api_core_version.__version__.split(".")[0:2]
|
|
413
|
-
]
|
|
414
|
-
if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15):
|
|
415
|
-
client = client_class(
|
|
416
|
-
client_options={"universe_domain": "bar.com"},
|
|
417
|
-
transport=transport_class(
|
|
418
|
-
credentials=ga_credentials.AnonymousCredentials(),
|
|
419
|
-
),
|
|
420
|
-
)
|
|
421
|
-
with pytest.raises(ValueError) as excinfo:
|
|
422
|
-
client._validate_universe_domain()
|
|
423
|
-
assert (
|
|
424
|
-
str(excinfo.value)
|
|
425
|
-
== "The configured universe domain (bar.com) does not match the universe domain found in the credentials (googleapis.com). If you haven't configured the universe domain explicitly, `googleapis.com` is the default."
|
|
426
|
-
)
|
|
427
|
-
|
|
428
|
-
# Test that ValueError is raised if universe_domain is provided via client options and credentials is None
|
|
429
|
-
with pytest.raises(ValueError):
|
|
430
|
-
client._compare_universes("foo.bar", None)
|
|
431
|
-
|
|
432
|
-
|
|
433
345
|
@pytest.mark.parametrize(
|
|
434
346
|
"client_class,transport_name",
|
|
435
347
|
[
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin/__init__.py
RENAMED
|
File without changes
|
{google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/google/analytics/admin/py.typed
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{google_analytics_admin-0.23.1 → google_analytics_admin-0.23.2}/tests/unit/gapic/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|