()
| 375 | |
| 376 | |
| 377 | def test_winreg(): |
| 378 | from winreg import OpenKey, EnumKey, CloseKey, HKEY_LOCAL_MACHINE |
| 379 | |
| 380 | def hook(event, args): |
| 381 | if not event.startswith("winreg."): |
| 382 | return |
| 383 | print(event, *args) |
| 384 | |
| 385 | sys.addaudithook(hook) |
| 386 | |
| 387 | k = OpenKey(HKEY_LOCAL_MACHINE, "Software") |
| 388 | EnumKey(k, 0) |
| 389 | try: |
| 390 | EnumKey(k, 10000) |
| 391 | except OSError: |
| 392 | pass |
| 393 | else: |
| 394 | raise RuntimeError("Expected EnumKey(HKLM, 10000) to fail") |
| 395 | |
| 396 | kv = k.Detach() |
| 397 | CloseKey(kv) |
| 398 | |
| 399 | |
| 400 | def test_socket(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…