1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-01-31 18:21:10 +00:00
thefuck/tests/functional/test_install.py

25 lines
804 B
Python
Raw Normal View History

import pytest
from thefuck.main import _get_current_version
envs = ((u'bash', 'thefuck/ubuntu-bash', u'''
FROM ubuntu:latest
RUN apt-get update
RUN apt-get install -yy bash
'''), (u'bash', 'thefuck/generic-bash', u'''
FROM fedora:latest
2015-09-05 11:54:59 +03:00
RUN dnf install -yy python-devel sudo wget gcc
'''))
2015-09-06 01:13:44 +03:00
@pytest.mark.functional
@pytest.mark.skip_without_docker
@pytest.mark.parametrize('shell, tag, dockerfile', envs)
def test_installation(spawnu, shell, TIMEOUT, tag, dockerfile):
proc = spawnu(tag, dockerfile, shell)
proc.sendline(u'cat /src/install.sh | sh - && $0')
proc.sendline(u'thefuck --version')
assert proc.expect([TIMEOUT, u'thefuck {}'.format(_get_current_version())],
timeout=600)
proc.sendline(u'fuck')
assert proc.expect([TIMEOUT, u'No fucks given'])