Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additonal tests for minimum version check #3958

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions tests/functional/test_crt.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

from contextlib import ContextDecorator

import pytest
from botocore.compat import HAS_CRT
from botocore.credentials import Credentials

Expand Down Expand Up @@ -71,9 +72,18 @@ def test_create_transfer_manager_on_optimized_instance(self):
def test_minimum_crt_version(self):
assert has_minimum_crt_version((0, 16, 12)) is True

@pytest.mark.parametrize(
"bad_version",
(
None,
"0.1.0-dev",
"0.20",
object(),
),
)
@requires_crt()
def test_minimum_crt_version_bad_crt_version(self):
def test_minimum_crt_version_bad_crt_version(self, bad_version):
with mock.patch("awscrt.__version__") as vers:
vers.return_value = None
vers.return_value = bad_version

assert has_minimum_crt_version((0, 16, 12)) is False