diff --git a/appveyor.yml b/appveyor.yml index b837dd5baa9df0b31cbda97f125d3a55184186a3..81705c9b9cd1951fe7121d0b7c3d3ae9f5689427 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,7 +15,7 @@ install: - choco install -y npcap wireshark - ps: .\.appveyor\InstallWindump.ps1 # Install Python modules - - "%PYTHON%\\python -m pip install cryptography coverage mock pyreadline keyboard" + - "%PYTHON%\\python -m pip install cryptography coverage mock pyreadline" - set PATH="%PYTHON%\\Scripts\\;%PATH%" test_script: diff --git a/test/mock_windows.uts b/test/mock_windows.uts index 01f644b074d78bb15c9df59d3a73a633ac40d67b..67b6e3ff291755f855f0985b82ae2773ca0b80d3 100644 --- a/test/mock_windows.uts +++ b/test/mock_windows.uts @@ -82,21 +82,6 @@ import sys import mock import readline -from threading import Thread, Event - -class sendTextAndTab(Thread): - """Send text directly as Input""" - def __init__(self, event, text): - Thread.__init__(self) - self.stopped = event - self.send_text = text - def run(self): - import keyboard - time.sleep(1) - while not self.stopped.wait(0.5): - keyboard.write(self.send_text) - keyboard.send("tab") - keyboard.send("enter") index = 0 @mock.patch("pyreadline.console.console.Console.size") @@ -114,12 +99,8 @@ def emulate_main_input(data, mock_readfunc, mock_pyr_size): r_data = data[index] if r_data.startswith("#AUTOCOMPLETE"): send_text = re.match(r'#AUTOCOMPLETE{(.*)}', r_data).group(1) - stopFlag = Event() - thread = sendTextAndTab(stopFlag, send_text) - thread.start() - # This will block the program until the thread has pushed the stuff - r_data = readline.rl.readline() - stopFlag.set() + cmpl = readline.rl.get_completer() + r_data = cmpl(send_text, 0) index +=1 print r_data return r_data