torrent/tracker/tracker_test.go

29 lines
543 B
Go
Raw Normal View History

2014-03-16 15:31:06 +00:00
package tracker
import (
"crypto/tls"
"net"
"net/http"
2014-03-16 15:31:06 +00:00
"testing"
"time"
2014-03-16 15:31:06 +00:00
)
var defaultClient = &http.Client{
Timeout: time.Second * 15,
Transport: &http.Transport{
Dial: (&net.Dialer{
Timeout: 15 * time.Second,
}).Dial,
TLSHandshakeTimeout: 15 * time.Second,
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
},
}
2014-03-16 15:31:06 +00:00
func TestUnsupportedTrackerScheme(t *testing.T) {
t.Parallel()
_, err := Announce(defaultClient, "lol://tracker.openbittorrent.com:80/announce", nil)
2014-03-16 15:31:06 +00:00
if err != ErrBadScheme {
t.Fatal(err)
}
}