Skip to content

Commit 8988b7c

Browse files
committed
Merge remote-tracking branch 'aws-master/master'
# Conflicts: # awsshell/app.py
2 parents 89b1562 + 609b423 commit 8988b7c

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

awsshell/app.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,8 @@ class AWSShell(object):
220220
221221
"""
222222

223-
def __init__(self, completer, model_completer, docs):
223+
def __init__(self, completer, model_completer, docs,
224+
input=None, output=None):
224225
self.completer = completer
225226
self.model_completer = model_completer
226227
self.history = InMemoryHistory()
@@ -233,6 +234,8 @@ def __init__(self, completer, model_completer, docs):
233234
self._dot_cmd = DotCommandHandler()
234235
self._env = os.environ.copy()
235236
self._profile = None
237+
self._input = input
238+
self._output = output
236239
self.prompt_tokens = u'aws > '
237240

238241
# These attrs come from the config file.
@@ -481,7 +484,8 @@ def create_cli_interface(self, display_completions_in_columns):
481484
app = self.create_application(self.completer,
482485
self.file_history,
483486
display_completions_in_columns)
484-
cli = CommandLineInterface(application=app, eventloop=loop)
487+
cli = CommandLineInterface(application=app, eventloop=loop,
488+
input=self._input, output=self._output)
485489
return cli
486490

487491
@property

tests/integration/test_keys.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
# ANY KIND, either express or implied. See the License for the specific
1212
# language governing permissions and limitations under the License.
1313
import mock
14-
import sys
1514

15+
from prompt_toolkit.input import PipeInput
16+
from prompt_toolkit.output import DummyOutput
1617
from prompt_toolkit.key_binding.input_processor import KeyPress
1718
from prompt_toolkit.keys import Keys
18-
from prompt_toolkit.interface import CommandLineInterface
1919

2020
from tests.compat import unittest
2121
from awsshell.app import AWSShell, InputInterrupt
@@ -24,9 +24,15 @@
2424
class KeysTest(unittest.TestCase):
2525

2626
def setUp(self):
27-
self.aws_shell = AWSShell(None, mock.Mock(), mock.Mock())
27+
self.input = PipeInput()
28+
output = DummyOutput()
29+
self.aws_shell = AWSShell(None, mock.Mock(), mock.Mock(),
30+
input=self.input, output=output)
2831
self.processor = self.aws_shell.cli.input_processor
2932

33+
def tearDown(self):
34+
self.input.close()
35+
3036
def feed_key(self, key):
3137
self.processor.feed(KeyPress(key, u''))
3238
self.processor.process_keys()

0 commit comments

Comments
 (0)