From 56d048e62a30bba1f1a459db73a9cdaafcd680a8 Mon Sep 17 00:00:00 2001 From: Jason Reding Date: Mon, 16 Sep 2024 18:50:17 -0500 Subject: [PATCH] Formatting to conform to style guide. --- .../grpc/channelpool.py | 3 ++- .../tests/unit/grpc/channelpool/test_channel_pool.py | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/service/ni_measurement_plugin_sdk_service/grpc/channelpool.py b/packages/service/ni_measurement_plugin_sdk_service/grpc/channelpool.py index 3840d6154..a6719ef5a 100644 --- a/packages/service/ni_measurement_plugin_sdk_service/grpc/channelpool.py +++ b/packages/service/ni_measurement_plugin_sdk_service/grpc/channelpool.py @@ -103,7 +103,8 @@ def _is_local(self, target: str) -> bool: if hostname == "localhost" or hostname == "LOCALHOST": return True - # IPv6 addresses don't support parsing with leading/trailing brackets so we need to remove them. + # IPv6 addresses don't support parsing with leading/trailing brackets + # so we need to remove them. match = re.match(r"^\[(.*)\]$", hostname) if match: hostname = match.group(1) diff --git a/packages/service/tests/unit/grpc/channelpool/test_channel_pool.py b/packages/service/tests/unit/grpc/channelpool/test_channel_pool.py index e79295c6c..8d402fc14 100644 --- a/packages/service/tests/unit/grpc/channelpool/test_channel_pool.py +++ b/packages/service/tests/unit/grpc/channelpool/test_channel_pool.py @@ -6,15 +6,15 @@ @pytest.mark.parametrize( "target,expected_result", [ - ("127.0.0.1", False), # Port must be specified explicitly - ("[::1]", False), # Port must be specified explicitly - ("localhost", False), # Port must be specified explicitly + ("127.0.0.1", False), # Port must be specified explicitly + ("[::1]", False), # Port must be specified explicitly + ("localhost", False), # Port must be specified explicitly ("127.0.0.1:100", True), ("[::1]:100", True), ("localhost:100", True), - ("http://127.0.0.1", False), # Port must be specified explicitly - ("http://[::1]", False), # Port must be specified explicitly - ("http://localhost", False), # Port must be specified explicitly + ("http://127.0.0.1", False), # Port must be specified explicitly + ("http://[::1]", False), # Port must be specified explicitly + ("http://localhost", False), # Port must be specified explicitly ("http://127.0.0.1:100", True), ("http://[::1]:100", True), ("http://localhost:100", True),