File: test_command.py

package info (click to toggle)
clikit 0.6.2-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 984 kB
  • sloc: python: 9,575; sh: 6; makefile: 3
file content (24 lines) | stat: -rw-r--r-- 746 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from clikit.api.command import Command
from clikit.api.command import CommandCollection
from clikit.api.config.command_config import CommandConfig
from clikit.utils.command import find_similar_command_names


def test_find_similar_command_names():
    foobar_config = CommandConfig("foobar")
    bar_config = CommandConfig("bar")
    barfoo_config = CommandConfig("barfoo")
    fooo_config = CommandConfig("fooo")
    names = find_similar_command_names(
        "foo",
        CommandCollection(
            [
                Command(foobar_config),
                Command(bar_config),
                Command(barfoo_config),
                Command(fooo_config),
            ]
        ),
    )

    assert ["fooo", "foobar", "barfoo"] == names