Skip to content
This repository was archived by the owner on Jan 5, 2019. It is now read-only.

Commit b9d7153

Browse files
committed
fix(run): Set login and tty options to false as default
1 parent 36b88ea commit b9d7153

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docker/manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def __exit__(self, exc_type, exc_value, exc_traceback):
6060
if exc_value:
6161
raise exc_value
6262

63-
def run(self, command, working_directory='', stdin='', login=True, tty=True):
63+
def run(self, command, working_directory='', stdin='', login=False, tty=False):
6464
"""
6565
Runs the command with docker exec in the given working directory.
6666

tests/test_manager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ def test_with_statement_exception(self, mock_start, mock_stop):
6767
@mock.patch('re.search', lambda *x: None)
6868
def test_quotation_mark_handling(self, mock_run):
6969
docker = Docker()
70-
docker.run('echo "hi there"')
71-
docker.run("echo 'hi there'")
70+
docker.run('echo "hi there"', login=True, tty=True)
71+
docker.run("echo 'hi there'", login=True, tty=True)
7272
expected = (
7373
'docker exec -i -t {} bash --login -c \'cd ~/ && echo "hi there"\''.format(
7474
docker.container_name
@@ -96,7 +96,7 @@ def test_no_login(self, mock_run):
9696
docker = Docker()
9797
docker.run('ls', login=False)
9898
mock_run.assert_called_once_with(
99-
'docker exec -i -t {} bash -c \'cd ~/ && ls\''.format(docker.container_name),
99+
'docker exec -i {} bash -c \'cd ~/ && ls\''.format(docker.container_name),
100100
''
101101
)
102102

0 commit comments

Comments
 (0)