1
0
mirror of https://github.com/nvbn/thefuck.git synced 2024-10-05 18:31:10 +01:00

#N/A Implicitly prefix containers names

This commit is contained in:
nvbn 2015-07-24 08:09:08 +03:00
parent e1416a0127
commit 174ada054d
4 changed files with 8 additions and 7 deletions

View File

@ -2,7 +2,7 @@ import pytest
from tests.functional.plots import with_confirmation, without_confirmation
from tests.functional.utils import spawn, functional
containers = [('thefuck/ubuntu-python3-bash', '''
containers = [('ubuntu-python3-bash', '''
FROM ubuntu:latest
RUN apt-get update
RUN apt-get install -yy python3 python3-pip python3-dev
@ -10,7 +10,7 @@ RUN pip3 install -U setuptools
RUN ln -s /usr/bin/pip3 /usr/bin/pip
CMD ["/bin/bash"]
'''),
('thefuck/ubuntu-python2-bash', '''
('ubuntu-python2-bash', '''
FROM ubuntu:latest
RUN apt-get update
RUN apt-get install -yy python python-pip python-dev

View File

@ -2,7 +2,7 @@ import pytest
from tests.functional.plots import with_confirmation, without_confirmation
from tests.functional.utils import spawn, functional
containers = [('thefuck/ubuntu-python3-bash', '''
containers = [('ubuntu-python3-bash', '''
FROM ubuntu:latest
RUN apt-get update
RUN apt-get install -yy python3 python3-pip python3-dev fish
@ -10,7 +10,7 @@ RUN pip3 install -U setuptools
RUN ln -s /usr/bin/pip3 /usr/bin/pip
CMD ["/usr/bin/fish"]
'''),
('thefuck/ubuntu-python2-bash', '''
('ubuntu-python2-bash', '''
FROM ubuntu:latest
RUN apt-get update
RUN apt-get install -yy python python-pip python-dev fish

View File

@ -2,7 +2,7 @@ import pytest
from tests.functional.utils import spawn, functional
from tests.functional.plots import with_confirmation, without_confirmation
containers = [('thefuck/ubuntu-python3-zsh', '''
containers = [('ubuntu-python3-zsh', '''
FROM ubuntu:latest
RUN apt-get update
RUN apt-get install -yy python3 python3-pip python3-dev zsh
@ -10,7 +10,7 @@ RUN pip3 install -U setuptools
RUN ln -s /usr/bin/pip3 /usr/bin/pip
CMD ["/bin/zsh"]
'''),
('thefuck/ubuntu-python2-zsh', '''
('ubuntu-python2-zsh', '''
FROM ubuntu:latest
RUN apt-get update
RUN apt-get install -yy python python-pip python-dev zsh

View File

@ -17,12 +17,13 @@ def build_container(tag, dockerfile):
file.write(dockerfile)
if subprocess.call(['docker', 'build', '--tag={}'.format(tag), tmpdir],
cwd=root) != 0:
raise Exception("Can't build container")
raise Exception("Can't build a container")
shutil.rmtree(tmpdir)
@contextmanager
def spawn(tag, dockerfile):
tag = 'thefuck/{}'.format(tag)
build_container(tag, dockerfile)
proc = pexpect.spawnu(
'docker run --volume {}:/src --tty=true --interactive=true {}'.format(root, tag))