From fc4492f31dad89ee8aa3cda2155ee3826e46f2db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Andr=C3=A9s=20Margffoy=20Tuay?= Date: Thu, 22 Jun 2017 16:23:08 -0500 Subject: [PATCH] Minor test corrections --- winpty/tests/test_winpty_wrapper.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/winpty/tests/test_winpty_wrapper.py b/winpty/tests/test_winpty_wrapper.py index 6ed18438..6f8f3656 100644 --- a/winpty/tests/test_winpty_wrapper.py +++ b/winpty/tests/test_winpty_wrapper.py @@ -2,12 +2,9 @@ import os import pytest -import os.path as osp from winpty.winpty_wrapper import PTY CMD = r'C:\windows\system32\cmd.exe' -LOCATION = osp.realpath(osp.join(os.getcwd(), - osp.dirname(__file__))) @pytest.fixture(scope='module') @@ -23,7 +20,8 @@ def test_read(): while len(line) < 30: line = pty.read() line = str(line, 'utf-8') - assert LOCATION in line + loc = os.getcwd() + assert loc in line del pty @@ -32,10 +30,16 @@ def test_write(): line = pty.read() while len(line) < 10: line = pty.read() + text = 'Eggs, ham and spam ünicode' pty.write(text) + line = pty.read() while len(line) < 10: line = pty.read() line = str(line, 'utf-8') + assert text in line + + pty.close() + del pty