From d1e13fda8a84157939300ab76cbd1ac8a908d944 Mon Sep 17 00:00:00 2001 From: hakril Date: Wed, 22 May 2024 11:32:43 +0200 Subject: [PATCH] Improve test for unicode --- tests/test_pipe.py | 9 ++++----- tests/test_system.py | 7 ++++++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/test_pipe.py b/tests/test_pipe.py index 9a32f10..92c45d8 100644 --- a/tests/test_pipe.py +++ b/tests/test_pipe.py @@ -56,9 +56,8 @@ UNICODE_PIPE_NAME = u"Wyczyść moją rurę" def test_pipe_unicode_name(): with windows.pipe.create(UNICODE_PIPE_NAME) as np: - - # Try the connect API with the unicode name + # also Try the connect API with the unicode name np2 = windows.pipe.connect(UNICODE_PIPE_NAME) - import pdb;pdb.set_trace() - print(repr(np)) - print("LOL") \ No newline at end of file + assert np.name == np2.name == UNICODE_PIPE_NAME + assert UNICODE_PIPE_NAME in np.path + assert UNICODE_PIPE_NAME in np2.path \ No newline at end of file diff --git a/tests/test_system.py b/tests/test_system.py index 318869a..33f1216 100644 --- a/tests/test_system.py +++ b/tests/test_system.py @@ -35,7 +35,12 @@ class TestSystemWithCheckGarbage(object): assert ldrive assert ldrive.name assert ldrive.path - assert ldrive.volume_info + try: + assert ldrive.volume_info + except WindowsError as e: + #handle ERROR_NOT_READY returned by A: in github CI + if e.winerror != ERROR_NOT_READY: + raise def test_wmi(self): return windows.system.wmi