def test_register(): if WinDivert.is_registered(): WinDivert.unregister() while WinDivert.is_registered(): time.sleep(0.01) # pragma: no cover assert not WinDivert.is_registered() WinDivert.register() assert WinDivert.is_registered()
def test_unregister(): w = WinDivert("false") w.open() WinDivert.unregister() time.sleep(0.1) assert WinDivert.is_registered() w.close() # may not trigger immediately. while WinDivert.is_registered(): time.sleep(0.01) # pragma: no cover