mirror of
https://github.com/Hopiu/llm.git
synced 2026-03-18 13:40:25 +00:00
Ensure test does not fail due to random sort order of plugins
This commit is contained in:
parent
a31ae86c20
commit
4be2bbdc0e
1 changed files with 4 additions and 1 deletions
|
|
@ -296,13 +296,16 @@ def test_plugins_command():
|
|||
runner = CliRunner()
|
||||
result = runner.invoke(cli.cli, ["plugins"])
|
||||
assert result.exit_code == 0
|
||||
assert json.loads(result.output) == [
|
||||
expected = [
|
||||
{"name": "EchoModelPlugin", "hooks": ["register_models"]},
|
||||
{
|
||||
"name": "MockModelsPlugin",
|
||||
"hooks": ["register_embedding_models", "register_models"],
|
||||
},
|
||||
]
|
||||
actual = json.loads(result.output)
|
||||
actual.sort(key=lambda p: p["name"])
|
||||
assert actual == expected
|
||||
# Test the --hook option
|
||||
result2 = runner.invoke(cli.cli, ["plugins", "--hook", "register_embedding_models"])
|
||||
assert result2.exit_code == 0
|
||||
|
|
|
|||
Loading…
Reference in a new issue