mirror of
https://github.com/hakril/PythonForWindows
synced 2026-06-08 14:31:45 +00:00
Fixed tests for new import windows.pipe requirement
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import windows
|
||||
import windows.pipe
|
||||
|
||||
def test_handle_process_id():
|
||||
handle_with_process = [h for h in windows.system.handles if h.dwProcessId]
|
||||
@@ -20,7 +21,7 @@ TEST_FILE_FOR_HANDLE = r"C:\Windows\explorer.exe"
|
||||
|
||||
def test_remote_handle_type_and_name(proc32_64):
|
||||
# tmpfile
|
||||
proc32_64.execute_python("import windows")
|
||||
proc32_64.execute_python("import windows; import windows.pipe")
|
||||
# A filename that a normal process should not have a handle on (to be sur)
|
||||
proc32_64.execute_python(r"""f = open(r"{filename}")""".format(filename=TEST_FILE_FOR_HANDLE))
|
||||
proc32_64.execute_python(r"""h = windows.utils.get_handle_from_file(f)""")
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@ import time
|
||||
PIPE_NAME = "PFW_Test_Pipe"
|
||||
|
||||
rcode_test_ipc_pipe = """
|
||||
import windows
|
||||
import windows; import windows.pipe
|
||||
windows.pipe.send_object("{pipe}", {{'Hello': 2}})
|
||||
"""
|
||||
|
||||
@@ -20,7 +20,7 @@ def test_ipc_pipe(proc32_64):
|
||||
|
||||
|
||||
rcode_test_echo_pipe = """
|
||||
import windows
|
||||
import windows; import windows.pipe
|
||||
|
||||
with windows.pipe.create("{pipe}") as np:
|
||||
np.wait_connection()
|
||||
|
||||
@@ -8,6 +8,7 @@ import textwrap
|
||||
import shutil
|
||||
|
||||
import windows
|
||||
import windows.pipe
|
||||
import windows.generated_def as gdef
|
||||
import windows.native_exec.simple_x86 as x86
|
||||
import windows.native_exec.simple_x64 as x64
|
||||
@@ -169,7 +170,7 @@ class TestProcessWithCheckGarbage(object):
|
||||
|
||||
def test_execute_python_good_version(self, proc32_64):
|
||||
PIPE_NAME = "PFW_TEST_Pipe"
|
||||
rcode = r"""import sys; import windows; windows.pipe.send_object("{pipe}", list(sys.version_info))"""
|
||||
rcode = r"""import sys; import windows; import windows.pipe; windows.pipe.send_object("{pipe}", list(sys.version_info))"""
|
||||
|
||||
with windows.pipe.create(PIPE_NAME) as np:
|
||||
proc32_64.execute_python(rcode.format(pipe=PIPE_NAME))
|
||||
|
||||
Reference in New Issue
Block a user