MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / TestHTTPAll

Function TestHTTPAll

pkg/aria2/rpc/client_test.go:9–66  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func TestHTTPAll(t *testing.T) {
10 const targetURL = "https://nodejs.org/dist/index.json"
11 rpc, err := New(context.Background(), "http://localhost:6800/jsonrpc", "", time.Second, &DummyNotifier{})
12 if err != nil {
13 t.Fatal(err)
14 }
15 defer rpc.Close()
16 g, err := rpc.AddURI([]string{targetURL})
17 if err != nil {
18 t.Fatal(err)
19 }
20 println(g)
21 if _, err = rpc.TellActive(); err != nil {
22 t.Error(err)
23 }
24 if _, err = rpc.PauseAll(); err != nil {
25 t.Error(err)
26 }
27 if _, err = rpc.TellStatus(g); err != nil {
28 t.Error(err)
29 }
30 if _, err = rpc.GetURIs(g); err != nil {
31 t.Error(err)
32 }
33 if _, err = rpc.GetFiles(g); err != nil {
34 t.Error(err)
35 }
36 if _, err = rpc.GetPeers(g); err != nil {
37 t.Error(err)
38 }
39 if _, err = rpc.TellActive(); err != nil {
40 t.Error(err)
41 }
42 if _, err = rpc.TellWaiting(0, 1); err != nil {
43 t.Error(err)
44 }
45 if _, err = rpc.TellStopped(0, 1); err != nil {
46 t.Error(err)
47 }
48 if _, err = rpc.GetOption(g); err != nil {
49 t.Error(err)
50 }
51 if _, err = rpc.GetGlobalOption(); err != nil {
52 t.Error(err)
53 }
54 if _, err = rpc.GetGlobalStat(); err != nil {
55 t.Error(err)
56 }
57 if _, err = rpc.GetSessionInfo(); err != nil {
58 t.Error(err)
59 }
60 if _, err = rpc.Remove(g); err != nil {
61 t.Error(err)
62 }
63 if _, err = rpc.TellActive(); err != nil {
64 t.Error(err)
65 }
66}

Callers

nothing calls this directly

Calls 15

NewFunction · 0.70
CloseMethod · 0.65
AddURIMethod · 0.65
TellActiveMethod · 0.65
PauseAllMethod · 0.65
TellStatusMethod · 0.65
GetURIsMethod · 0.65
GetFilesMethod · 0.65
GetPeersMethod · 0.65
TellWaitingMethod · 0.65
TellStoppedMethod · 0.65
GetOptionMethod · 0.65

Tested by

no test coverage detected