1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-10-30 22:54:14 +00:00

#398 & #408: Support non-ascii IO in Python 2

This commit is contained in:
Pablo Santiago Blum de Aguiar
2015-11-04 23:08:13 -02:00
parent ad3db4ac67
commit fc05364233
14 changed files with 129 additions and 55 deletions

View File

@@ -1,3 +1,5 @@
# -*- coding: utf-8 -*-
import pytest
from pathlib import PosixPath
from thefuck import corrector, conf
@@ -53,7 +55,9 @@ def test_organize_commands():
"""Ensures that the function removes duplicates and sorts commands."""
commands = [CorrectedCommand('ls'), CorrectedCommand('ls -la', priority=9000),
CorrectedCommand('ls -lh', priority=100),
CorrectedCommand(u'echo café', priority=200),
CorrectedCommand('ls -lh', priority=9999)]
assert list(organize_commands(iter(commands))) \
== [CorrectedCommand('ls'), CorrectedCommand('ls -lh', priority=100),
CorrectedCommand(u'echo café', priority=200),
CorrectedCommand('ls -la', priority=9000)]