1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-03-14 14:48:49 +00:00

added german output test

This commit is contained in:
tobixx 2019-08-10 13:10:47 +02:00
parent 3015a0818f
commit d24b413d98

View File

@ -1,8 +1,10 @@
# -*- coding: utf-8 -*-
import pytest
from thefuck.rules.apt_list_upgradable import get_new_command, match
from thefuck.types import Command
match_output = '''
match_output = ['''
Hit:1 http://us.archive.ubuntu.com/ubuntu zesty InRelease
Hit:2 http://us.archive.ubuntu.com/ubuntu zesty-updates InRelease
Get:3 http://us.archive.ubuntu.com/ubuntu zesty-backports InRelease [89.2 kB]
@ -15,7 +17,9 @@ Reading package lists... Done
Building dependency tree
Reading state information... Done
8 packages can be upgraded. Run 'apt list --upgradable' to see them.
'''
''',
'Führen Sie »apt list --upgradable« aus, um sie anzuzeigen.'
]
no_match_output = '''
Hit:1 http://us.archive.ubuntu.com/ubuntu zesty InRelease
@ -48,8 +52,9 @@ All packages are up to date.
'''
def test_match():
assert match(Command('sudo apt update', match_output))
@pytest.mark.parametrize('output', match_output)
def test_match(output):
assert match(Command('sudo apt update', output))
@pytest.mark.parametrize('command', [
@ -67,9 +72,10 @@ def test_not_match(command):
assert not match(command)
def test_get_new_command():
new_command = get_new_command(Command('sudo apt update', match_output))
@pytest.mark.parametrize('output', match_output)
def test_get_new_command(output):
new_command = get_new_command(Command('sudo apt update', output))
assert new_command == 'sudo apt list --upgradable'
new_command = get_new_command(Command('apt update', match_output))
new_command = get_new_command(Command('apt update', output))
assert new_command == 'apt list --upgradable'