Skip to content

Commit b0ec8eb

Browse files
committed
Update test to account for always passing credentials now
1 parent 10896fd commit b0ec8eb

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

tests/test_urlutils.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -295,12 +295,15 @@ def test_bits_errors(localserver, tmp_path, inject_error):
295295

296296
# Inject an error when adding credentials
297297
inject_error(0, 0, 0, 0xA0000001)
298-
# No credentials specified, so does not raise
299-
try:
298+
# Implicit credentials are always specified
299+
with pytest.raises(OSError) as ex:
300300
job = _native.bits_begin(conn, "PyManager Test", url, dest)
301-
finally:
302-
_native.bits_cancel(conn, job)
303-
# Add credentials to cause injected error
301+
# Original error is ours
302+
assert ex.value.__context__.winerror & 0xFFFFFFFF == 0xA0000001
303+
# The final error is the missing message
304+
assert ex.value.winerror & 0xFFFFFFFF == ERROR_MR_MID_NOT_FOUND
305+
306+
# Add credentials also causes injected error
304307
with pytest.raises(OSError) as ex:
305308
job = _native.bits_begin(conn, "PyManager Test", url, dest, "x", "y")
306309
# Original error is ours

0 commit comments

Comments
 (0)