1
0
mirror of https://github.com/nvbn/thefuck.git synced 2024-10-06 02:41:10 +01:00
thefuck/tests/rules/test_apt_get_search.py
2015-08-25 08:09:31 +02:00

26 lines
678 B
Python

import pytest
from thefuck.rules.apt_get_search import get_new_command, match
from tests.utils import Command
def test_match():
assert match(Command('apt-get search foo'), None)
@pytest.mark.parametrize('command', [
Command('apt-cache search foo'),
Command('aptitude search foo'),
Command('apt search foo'),
Command('apt-get install foo'),
Command('apt-get source foo'),
Command('apt-get clean'),
Command('apt-get remove'),
Command('apt-get update')
])
def test_not_match(command):
assert not match(command, None)
def test_get_new_command():
assert get_new_command(Command('apt-get search foo'), None) == 'apt-cache search foo'