mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-03 19:54:09 +00:00
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 (
|
from hypothesis import (
|
||||||
given,
|
given,
|
||||||
|
note,
|
||||||
)
|
)
|
||||||
|
|
||||||
from hypothesis.strategies import (
|
from hypothesis.strategies import (
|
||||||
@ -118,7 +119,15 @@ class GetArgvTests(SyncTestCase):
|
|||||||
PIPE,
|
PIPE,
|
||||||
)
|
)
|
||||||
argv = [executable.decode("utf-8"), save_argv_path.path] + argv
|
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(
|
self.assertThat(
|
||||||
returncode,
|
returncode,
|
||||||
Equals(0),
|
Equals(0),
|
||||||
|
@ -26,8 +26,12 @@ def get_argv():
|
|||||||
use_last_error=True
|
use_last_error=True
|
||||||
)(("CommandLineToArgvW", windll.shell32))
|
)(("CommandLineToArgvW", windll.shell32))
|
||||||
|
|
||||||
|
import sys
|
||||||
|
|
||||||
|
command_line = GetCommandLine()
|
||||||
|
print("GetCommandLine() -> {!r}".format(command_line), file=sys.stderr)
|
||||||
argc = c_int(0)
|
argc = c_int(0)
|
||||||
argv_unicode = CommandLineToArgvW(GetCommandLine(), byref(argc))
|
argv_unicode = CommandLineToArgvW(command_line, byref(argc))
|
||||||
if argv_unicode is None:
|
if argv_unicode is None:
|
||||||
raise WinError(get_last_error())
|
raise WinError(get_last_error())
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user