Skip to content

Commit

Permalink
Merge pull request #24 from andfoy/test_corrections
Browse files Browse the repository at this point in the history
PR: Minor test corrections
  • Loading branch information
andfoy authored Jun 22, 2017
2 parents 120f068 + fc4492f commit 148b92e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions winpty/tests/test_winpty_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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


Expand All @@ -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

0 comments on commit 148b92e

Please sign in to comment.