|
32 | 32 | import json |
33 | 33 | import os |
34 | 34 | import pickle |
| 35 | +import pytest |
35 | 36 | import re |
36 | 37 | import sys |
37 | 38 | import unittest |
|
40 | 41 |
|
41 | 42 | import google.api_core.exceptions |
42 | 43 | import google.auth.credentials |
| 44 | +from google.auth import __version__ as auth_version |
43 | 45 | from google.auth.exceptions import MutualTLSChannelError |
44 | 46 | import google_auth_httplib2 |
45 | 47 | import httplib2 |
|
61 | 63 | except ImportError: |
62 | 64 | HAS_UNIVERSE = False |
63 | 65 |
|
| 66 | +from google.api_core import parse_version_to_tuple |
64 | 67 | from googleapiclient import _helpers as util |
65 | 68 | from googleapiclient.discovery import (DISCOVERY_URI, |
66 | 69 | MEDIA_BODY_PARAMETER_DEFAULT_VALUE, |
@@ -889,6 +892,11 @@ def test_mtls_with_provided_client_cert( |
889 | 892 | ("always", "", CONFIG_DATA_WITHOUT_WORKLOAD, MTLS_ENDPOINT), |
890 | 893 | ] |
891 | 894 | ) |
| 895 | + @pytest.mark.skipif( |
| 896 | + parse_version_to_tuple(auth_version) < (2,43,0), |
| 897 | + reason="automatic mtls enablement when supported certs present only" |
| 898 | + "enabled in google-auth<=2.43.0" |
| 899 | + ) |
892 | 900 | def test_mtls_with_provided_client_cert_unset_environment_variable( |
893 | 901 | self, use_mtls_env, use_client_cert, config_data, base_url |
894 | 902 | ): |
@@ -1016,6 +1024,11 @@ def test_mtls_with_default_client_cert( |
1016 | 1024 | @mock.patch( |
1017 | 1025 | "google.auth.transport.mtls.default_client_encrypted_cert_source", autospec=True |
1018 | 1026 | ) |
| 1027 | + @pytest.mark.skipif( |
| 1028 | + parse_version_to_tuple(auth_version) < (2,43,0), |
| 1029 | + reason="automatic mtls enablement when supported certs present only" |
| 1030 | + "enabled in google-auth<=2.43.0" |
| 1031 | + ) |
1019 | 1032 | def test_mtls_with_default_client_cert_with_unset_environment_variable( |
1020 | 1033 | self, |
1021 | 1034 | use_mtls_env, |
|
0 commit comments