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