]> Sergey Matveev's repositories - btrtrc.git/blobdiff - tests/webseed-partial-seed/herp_test.go
Don't starve unverified bytes limit on unrequestable pieces
[btrtrc.git] / tests / webseed-partial-seed / herp_test.go
index 3c1b731f2d7e104d2d2c0ce3b3d9388a32a9b8d1..8eedff36850963bbdfa55f4613a54c909dc1115e 100644 (file)
@@ -1,17 +1,18 @@
 package webseed_partial_seed
 
 import (
-       "github.com/anacrolix/torrent"
-       "github.com/anacrolix/torrent/internal/testutil"
-       qt "github.com/frankban/quicktest"
        "path/filepath"
        "runtime"
        "testing"
+
+       "github.com/anacrolix/torrent"
+       "github.com/anacrolix/torrent/internal/testutil"
+       qt "github.com/frankban/quicktest"
 )
 
-func testdataDir() string {
+func testSrcDir() string {
        _, b, _, _ := runtime.Caller(0)
-       return filepath.Join(filepath.Dir(b), "../../testdata")
+       return filepath.Dir(b)
 }
 
 func makeSeederClient(t *testing.T) *torrent.Client {
@@ -54,7 +55,7 @@ func TestWebseedPartialSeed(t *testing.T) {
        defer seederClient.Close()
        testutil.ExportStatusWriter(seederClient, "seeder", t)
        const infoHashHex = "a88fda5954e89178c372716a6a78b8180ed4dad3"
-       metainfoPath := filepath.Join(testdataDir(), "test.img.torrent")
+       metainfoPath := filepath.Join(testSrcDir(), "test.img.torrent")
        seederTorrent, err := seederClient.AddTorrentFromFile(metainfoPath)
        assertOk(err)
        leecherClient := makeLeecherClient(t)