Skip to content

Commit

Permalink
new unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
David Miller committed Jun 23, 2022
1 parent cd1e8b4 commit d3534c8
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/unit/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
import os
from contextlib import closing

import pytest

import botocore
import botocore.config
from botocore import client, exceptions, hooks
Expand Down Expand Up @@ -1617,6 +1620,17 @@ def test_sslCommonName_warning(self):
)
self.assertEqual(len(warning.warnings), 1)

@mock.patch.dict(os.environ, {'BOTO_DISABLE_COMMONNAME': 'true'})
def test_BOTO_DISABLE_COMMONNAME(self):
creator = self.create_client_creator()
self.endpoint_data['sslCommonName'] = 'bar'

with pytest.warns(None) as warning:
creator.create_client(
'myservice', 'us-west-2', credentials=self.credentials
)
self.assertEqual(len(warning), 0)


class TestClientErrors(TestAutoGeneratedClient):
def add_error_response(self, error_response):
Expand Down

0 comments on commit d3534c8

Please sign in to comment.