mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-09-21 11:39:57 +03:00
Make JSON reading test a bit more robust
This commit is contained in:
parent
cb0d23bae8
commit
94551623ec
@ -47,7 +47,6 @@ def report_screen_size_change(*a):
|
||||
'font_family': get_options().font_family,
|
||||
'cols': read_screen_size(fd=sys.stderr.fileno()).cols,
|
||||
'stdin_data': sys.stdin.read(),
|
||||
|
||||
'done': 'hello',
|
||||
}
|
||||
print(json.dumps(output, indent=2), file=sys.stderr, flush=True)
|
||||
@ -114,7 +113,12 @@ def wait_for_death(exit_code, timeout=5):
|
||||
stdin_data = 'testing--stdin-read'
|
||||
with open(stdin_w, 'w') as f:
|
||||
f.write(stdin_data)
|
||||
pty.wait_till(lambda: 'hello' in pty.screen_contents())
|
||||
|
||||
def has_json():
|
||||
s = pty.screen_contents().strip()
|
||||
return 'hello' in s and s.endswith('}')
|
||||
|
||||
pty.wait_till(has_json)
|
||||
wait_for_death(exit_code)
|
||||
output = json.loads(pty.screen_contents().strip())
|
||||
self.assertEqual(output['test_env'], env['TEST_ENV_PASS'])
|
||||
|
Loading…
Reference in New Issue
Block a user