-
Notifications
You must be signed in to change notification settings - Fork 11
MESH-2092 Combined Dependabot PRs #138
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
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
937ebbc
github actions (deps): bump actions/upload-artifact from 5 to 6
dependabot[bot] 0ffe13d
github actions (deps): bump mikepenz/action-junit-report
dependabot[bot] d92c9e3
Bump pytest from 8.4.2 to 9.0.2
dependabot[bot] b506ff5
Bump types-setuptools from 80.9.0.20251223 to 80.10.0.20260124
dependabot[bot] 20f7eac
Bump boto3 from 1.42.33 to 1.42.39
dependabot[bot] a157115
Bump coverage from 7.13.1 to 7.13.2
dependabot[bot] 8714b75
Bump black from 25.12.0 to 26.1.0
dependabot[bot] 2aa2f85
Merge dependabot/pip/black-26.1.0 into mesh-2092-dependabot-combined
github-actions[bot] 2cb142a
Merge dependabot/pip/coverage-7.13.2 into mesh-2092-dependabot-combined
github-actions[bot] ff09a3f
Merge dependabot/pip/boto3-1.42.39 into mesh-2092-dependabot-combined
github-actions[bot] 31b4289
Merge dependabot/pip/types-setuptools-80.10.0.20260124 into mesh-2092…
github-actions[bot] edd3855
Merge dependabot/github_actions/mikepenz/action-junit-report-6.1.0 in…
github-actions[bot] 1427525
Merge remote-tracking branch 'origin/dependabot/pip/pytest-9.0.2' int…
allenburgess1-nhs 334b8f5
Merge remote-tracking branch 'origin/dependabot/github_actions/action…
allenburgess1-nhs b14716b
mesh-2092: update deps
allenburgess1-nhs d40b8f2
mesh-2092: black & ruff reformating
allenburgess1-nhs eb29269
mesh-2092: removed cert and verify check for unsupported types
allenburgess1-nhs e5f0485
mesh-2092: added test for code coverage
allenburgess1-nhs cab80c0
Revert "mesh-2092: added test for code coverage"
allenburgess1-nhs 62f438f
mesh-2092: added unit test coverage
allenburgess1-nhs 632e2de
mesh-2092: re-added check for verify as bytes and cert as list
allenburgess1-nhs 156c98c
mesh-2092: added mypy ignores
allenburgess1-nhs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "python.testing.pytestArgs": [ | ||
| "." | ||
| ], | ||
| "python.testing.unittestEnabled": false, | ||
| "python.testing.pytestEnabled": true | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
allenburgess1-nhs marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| from __future__ import annotations | ||
|
|
||
| from unittest.mock import Mock | ||
|
|
||
| import pytest | ||
|
|
||
| import mesh_client | ||
|
|
||
|
|
||
| class SSLContextStub: | ||
| def __init__(self) -> None: | ||
| self.load_cert_chain = Mock() | ||
| self.load_verify_locations = Mock() | ||
| self.minimum_version = None | ||
| self.check_hostname = None | ||
| self.verify_mode = None | ||
| self.hostname_checks_common_name = None | ||
|
|
||
|
|
||
| @pytest.mark.parametrize( | ||
| ("certs", "loads_cert_chain_called"), | ||
| [ | ||
| (("client.crt", "client.key"), True), | ||
| (None, False), | ||
| (["client.crt", "client.key"], True), | ||
| ], | ||
| ) | ||
| def test_create_ssl_context_loads_cert_chain( | ||
| monkeypatch, certs: tuple[str, str] | list[str] | None, loads_cert_chain_called: bool | ||
| ): | ||
|
|
||
| dummy_context = SSLContextStub() | ||
| monkeypatch.setattr(mesh_client, "create_urllib3_context", lambda: dummy_context) | ||
|
|
||
| adapter = mesh_client.SSLContextAdapter(cert=certs, verify=None) # type: ignore[arg-type] | ||
| dummy_context.load_cert_chain.reset_mock() | ||
|
|
||
| context = adapter.create_ssl_context() | ||
|
|
||
| assert context is dummy_context | ||
|
|
||
| if loads_cert_chain_called: | ||
| assert certs is not None | ||
| dummy_context.load_cert_chain.assert_called_with(*certs) | ||
| else: | ||
| dummy_context.load_cert_chain.assert_not_called() | ||
|
|
||
|
|
||
| @pytest.mark.parametrize("verify", [True, False, "/path/to/ca.pem", b"/path/to/ca.pem", None]) | ||
| def test_create_ssl_context_loads_verify_locations_when_verify_is_provided( | ||
| monkeypatch, verify: bool | str | bytes | None | ||
| ): | ||
|
|
||
| dummy_context = SSLContextStub() | ||
| monkeypatch.setattr(mesh_client, "create_urllib3_context", lambda: dummy_context) | ||
|
|
||
| adapter = mesh_client.SSLContextAdapter(cert=None, verify=verify) # type: ignore[arg-type] | ||
| context = adapter.create_ssl_context() | ||
|
|
||
| assert context is dummy_context | ||
|
|
||
| if type(verify) in (str, bytes): | ||
| dummy_context.load_verify_locations.assert_called_with(verify) | ||
| else: | ||
| dummy_context.load_verify_locations.assert_not_called() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.