MCPcopy Index your code
hub / github.com/RustPython/RustPython / check_getwch

Method check_getwch

Lib/test/test_msvcrt.py:84–92  ·  view source on GitHub ↗
(self, funcname)

Source from the content-addressed store, hash-verified

82 self.assertEqual(msvcrt.getch(), b'c')
83
84 def check_getwch(self, funcname):
85 code = dedent(f'''
86 import msvcrt
87 from _testconsole import write_input
88 with open("CONIN$", "rb", buffering=0) as stdin:
89 write_input(stdin, {ascii(c_encoded)})
90 assert msvcrt.{funcname}() == "{c}"
91 ''')
92 self.run_in_separated_process(code)
93
94 def test_getwch(self):
95 self.check_getwch('getwch')

Callers 2

test_getwchMethod · 0.95
test_getwcheMethod · 0.95

Calls 3

dedentFunction · 0.90
asciiFunction · 0.85

Tested by

no test coverage detected