Exemple #1
0
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('ls -lh', priority=9999)]
    assert list(organize_commands(iter(commands))) \
        == [CorrectedCommand('ls'), CorrectedCommand('ls -lh', priority=100),
            CorrectedCommand('ls -la', priority=9000)]
Exemple #2
0
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)]
Exemple #3
0
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),
    ]