mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-06 16:40:32 +00:00
add test
This commit is contained in:
1 parent
63296f6950
commit
a06549a11a
13 files changed
+135
-100
No files matched your search
+3
-2
@@ -7,8 +7,6 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
var instance, _ = Create(nil)
|
||||
|
||||
func TestInvoke(t *testing.T) {
|
||||
doTestInvoke(t, "Info", []any{}, model.CodeOk)
|
||||
doTestInvoke(t, "Info1", []any{}, model.CodeError)
|
||||
@@ -21,6 +19,9 @@ func TestInvoke(t *testing.T) {
|
||||
}
|
||||
|
||||
func doTestInvoke(t *testing.T, method string, params []any, expectCode model.RespCode) {
|
||||
instance, _ := Create(nil)
|
||||
defer instance.Close()
|
||||
|
||||
result := Invoke(instance, &Request{
|
||||
Method: method,
|
||||
Params: params,
|
||||
|
||||
Reference in new issue
Block a user