summaryrefslogtreecommitdiff
path: root/tests/Network/BitTorrent
diff options
context:
space:
mode:
authorSam Truzjan <pxqr.sta@gmail.com>2014-02-28 20:17:32 +0400
committerSam Truzjan <pxqr.sta@gmail.com>2014-02-28 20:17:32 +0400
commit6943ed2b9c7a4bb9a066a42a4611c2158e2e5282 (patch)
tree7d69d86ed1bb2a636ac01e168228ef932e0908b6 /tests/Network/BitTorrent
parent6fb35776834fedeeff3e52e719c3aa55c18d35c6 (diff)
Spec: Pass known torrents in announce requests
Diffstat (limited to 'tests/Network/BitTorrent')
-rw-r--r--tests/Network/BitTorrent/Tracker/RPC/HTTPSpec.hs3
-rw-r--r--tests/Network/BitTorrent/Tracker/TestData.hs12
2 files changed, 10 insertions, 5 deletions
diff --git a/tests/Network/BitTorrent/Tracker/RPC/HTTPSpec.hs b/tests/Network/BitTorrent/Tracker/RPC/HTTPSpec.hs
index c2af32c8..2a00c96c 100644
--- a/tests/Network/BitTorrent/Tracker/RPC/HTTPSpec.hs
+++ b/tests/Network/BitTorrent/Tracker/RPC/HTTPSpec.hs
@@ -61,7 +61,8 @@ spec = parallel $ do
61 it "have valid response" $ do 61 it "have valid response" $ do
62 withManager def $ \ mgr -> do 62 withManager def $ \ mgr -> do
63-- q <- arbitrarySample 63-- q <- arbitrarySample
64 let q = AnnounceQuery def "-HS0003-203534.37420" 6000 64 let ih = maybe def L.head hashList
65 let q = AnnounceQuery ih "-HS0003-203534.37420" 6000
65 (Progress 0 0 0) Nothing Nothing (Just Started) 66 (Progress 0 0 0) Nothing Nothing (Just Started)
66 info <- announce mgr trackerURI q 67 info <- announce mgr trackerURI q
67 validateInfo q info 68 validateInfo q info
diff --git a/tests/Network/BitTorrent/Tracker/TestData.hs b/tests/Network/BitTorrent/Tracker/TestData.hs
index bfb1bff0..e0edba25 100644
--- a/tests/Network/BitTorrent/Tracker/TestData.hs
+++ b/tests/Network/BitTorrent/Tracker/TestData.hs
@@ -72,11 +72,15 @@ notWorking name uri = (trackerEntry uri)
72 72
73trackers :: [TrackerEntry] 73trackers :: [TrackerEntry]
74trackers = 74trackers =
75 [ announceOnly "LinuxTracker" 75 [ (announceOnly "LinuxTracker"
76 "http://linuxtracker.org:2710/00000000000000000000000000000000/announce" 76 "http://linuxtracker.org:2710/00000000000000000000000000000000/announce")
77 { hashList = Just ["1c82a95b9e02bf3db4183da072ad3ef656aacf0e"] -- debian 7
78 }
79
80 , (announceScrape "Arch" "http://tracker.archlinux.org:6969/announce")
81 { hashList = Just ["bc9ae647a3e6c3636de58535dd3f6360ce9f4621"]
82 }
77 83
78 -- from "http://www.linux23.com/"
79 , announceScrape "Arch" "http://tracker.archlinux.org:6969/announce"
80 , notWorking "rarbg" "udp://9.rarbg.com:2710/announce" 84 , notWorking "rarbg" "udp://9.rarbg.com:2710/announce"
81 85
82 , announceScrape "OpenBitTorrent" "udp://tracker.openbittorrent.com:80/announce" 86 , announceScrape "OpenBitTorrent" "udp://tracker.openbittorrent.com:80/announce"