]> Sergey Matveev's repositories - btrtrc.git/blob - testing.go
Use different keep alive timeout in tests
[btrtrc.git] / testing.go
1 package torrent
2
3 import (
4         "testing"
5         "time"
6 )
7
8 func TestingConfig(t testing.TB) *ClientConfig {
9         cfg := NewDefaultClientConfig()
10         cfg.ListenHost = LoopbackListenHost
11         cfg.NoDHT = true
12         cfg.DataDir = t.TempDir()
13         cfg.DisableTrackers = true
14         cfg.NoDefaultPortForwarding = true
15         cfg.DisableAcceptRateLimiting = true
16         cfg.ListenPort = 0
17         cfg.KeepAliveTimeout = time.Microsecond
18         //cfg.Debug = true
19         //cfg.Logger = cfg.Logger.WithText(func(m log.Msg) string {
20         //      t := m.Text()
21         //      m.Values(func(i interface{}) bool {
22         //              t += fmt.Sprintf("\n%[1]T: %[1]v", i)
23         //              return true
24         //      })
25         //      return t
26         //})
27         return cfg
28 }