see if GetCommandLine() value is interesting
This commit is contained in:
parent
e2f3964451
commit
389d70a682
|
@ -49,6 +49,7 @@ from testtools.matchers import (
|
|||
|
||||
from hypothesis import (
|
||||
given,
|
||||
note,
|
||||
)
|
||||
|
||||
from hypothesis.strategies import (
|
||||
|
@ -118,7 +119,15 @@ class GetArgvTests(SyncTestCase):
|
|||
PIPE,
|
||||
)
|
||||
argv = [executable.decode("utf-8"), save_argv_path.path] + argv
|
||||
returncode = Popen(argv, stdin=PIPE, stdout=PIPE, stderr=PIPE).wait()
|
||||
p = Popen(argv, stdin=PIPE, stdout=PIPE, stderr=PIPE)
|
||||
p.stdin.close()
|
||||
stdout = p.stdout.read()
|
||||
stderr = p.stderr.read()
|
||||
returncode = p.wait()
|
||||
|
||||
note("stdout: {!r}".format(stdout))
|
||||
note("stderr: {!r}".format(stderr))
|
||||
|
||||
self.assertThat(
|
||||
returncode,
|
||||
Equals(0),
|
||||
|
|
|
@ -26,8 +26,12 @@ def get_argv():
|
|||
use_last_error=True
|
||||
)(("CommandLineToArgvW", windll.shell32))
|
||||
|
||||
import sys
|
||||
|
||||
command_line = GetCommandLine()
|
||||
print("GetCommandLine() -> {!r}".format(command_line), file=sys.stderr)
|
||||
argc = c_int(0)
|
||||
argv_unicode = CommandLineToArgvW(GetCommandLine(), byref(argc))
|
||||
argv_unicode = CommandLineToArgvW(command_line, byref(argc))
|
||||
if argv_unicode is None:
|
||||
raise WinError(get_last_error())
|
||||
|
||||
|
|
Loading…
Reference in New Issue