mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-08 09:30:27 +00:00
25 lines
487 B
Go
25 lines
487 B
Go
package bt
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestClient_AddTorrent(t *testing.T) {
|
|
client := NewClient()
|
|
metaInfo, err := ParseFromFile("testdata/Game.of.Thrones.S08E05.720p.WEB.H264-MEMENTO.torrent")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
torrent := &Torrent{
|
|
client: client,
|
|
MetaInfo: metaInfo,
|
|
}
|
|
torrent.MetaInfo.Announce = "udp://tracker.opentrackr.org:1337/announce"
|
|
torrent.MetaInfo.AnnounceList = [][]string{}
|
|
err = torrent.Tracker()
|
|
if err != nil {
|
|
panic(err)
|
|
return
|
|
}
|
|
}
|