Skip to content

Commit 1735af2

Browse files
style: fix black formatting in test_named_pipe_helper.py
Signed-off-by: Leon Li <2182521+leon-li-inspire@users.noreply.github.com>
1 parent 00af376 commit 1735af2

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

‎test/openjd/adaptor_runtime/unit/named_pipe/test_named_pipe_helper.py‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ def test_failed_to_generate_pipe_name(self, mock_check_named_pipe_exists, mock_g
104104
@patch("getpass.getuser", return_value="regularuser")
105105
def test_create_security_attributes_uses_lookup(self, mock_getuser):
106106
win32security = pytest.importorskip("win32security")
107-
with patch.object(win32security, "LookupAccountName", return_value=("fake_sid", None, None)) as mock_lookup:
107+
with patch.object(
108+
win32security, "LookupAccountName", return_value=("fake_sid", None, None)
109+
) as mock_lookup:
108110
named_pipe_helper.NamedPipeHelper.create_security_attributes()
109111
mock_lookup.assert_called_once_with("", "regularuser")
110112

@@ -114,7 +116,9 @@ def test_create_security_attributes_retries_on_lsa_not_ready(self, mock_getuser,
114116
# ERROR_NONE_MAPPED (1332) is raised when LSA hasn't finished initializing on a
115117
# fresh EC2 instance. The lookup should retry with exponential backoff and succeed.
116118
win32security = pytest.importorskip("win32security")
117-
lsa_error = pywintypes.error(1332, "LookupAccountName", "No mapping between account names and security IDs was done.")
119+
lsa_error = pywintypes.error(
120+
1332, "LookupAccountName", "No mapping between account names and security IDs was done."
121+
)
118122
with patch.object(
119123
win32security, "LookupAccountName", side_effect=[lsa_error, ("fake_sid", None, None)]
120124
) as mock_lookup:
@@ -127,7 +131,9 @@ def test_create_security_attributes_retries_on_lsa_not_ready(self, mock_getuser,
127131
def test_create_security_attributes_raises_after_max_retries(self, mock_getuser, mock_sleep):
128132
# After exhausting all retries, the original error should be re-raised.
129133
win32security = pytest.importorskip("win32security")
130-
lsa_error = pywintypes.error(1332, "LookupAccountName", "No mapping between account names and security IDs was done.")
134+
lsa_error = pywintypes.error(
135+
1332, "LookupAccountName", "No mapping between account names and security IDs was done."
136+
)
131137
with patch.object(win32security, "LookupAccountName", side_effect=lsa_error):
132138
with pytest.raises(pywintypes.error) as exc_info:
133139
named_pipe_helper.NamedPipeHelper.create_security_attributes()

0 commit comments

Comments
 (0)