diff --git a/models/commands_test.go b/models/commands_test.go new file mode 100644 index 0000000000000000000000000000000000000000..08a2582b69220a8750cda0803e8e3ce18e8167a4 --- /dev/null +++ b/models/commands_test.go @@ -0,0 +1,25 @@ +/* + * @Author: bixiaoyan bixiaoyan@kylinos.cn + * @Date: 2024-08-20 14:00:58 + * @LastEditors: bixiaoyan bixiaoyan@kylinos.cn + * @LastEditTime: 2024-08-20 14:49:01 + * @FilePath: /ha-api/models/commands_test.go + * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + */ +package models + +import "testing" + +func TestGetCommandsList(t *testing.T) { + result := GetCommandsList() + if result["action"] != true { + t.Fatal("Get commands list failed") + } +} + +func TestRunBuiltinCommand(t *testing.T) { + _, res := RunBuiltinCommand(1) + if res != nil { + t.Fatal("Get command result failed") + } +}