summaryrefslogtreecommitdiff
path: root/tests/Network
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Network')
-rw-r--r--tests/Network/BitTorrent/Exchange/SessionSpec.hs24
1 files changed, 11 insertions, 13 deletions
diff --git a/tests/Network/BitTorrent/Exchange/SessionSpec.hs b/tests/Network/BitTorrent/Exchange/SessionSpec.hs
index 9f6f11a1..745649fe 100644
--- a/tests/Network/BitTorrent/Exchange/SessionSpec.hs
+++ b/tests/Network/BitTorrent/Exchange/SessionSpec.hs
@@ -1,31 +1,29 @@
1{-# LANGUAGE RecordWildCards #-}
1module Network.BitTorrent.Exchange.SessionSpec (spec) where 2module Network.BitTorrent.Exchange.SessionSpec (spec) where
2import Test.Hspec 3import Test.Hspec
3 4
4import Data.Torrent 5import Data.Torrent
5import Network.BitTorrent.Core 6import Network.BitTorrent.Core
6import Network.BitTorrent.Exchange.Session 7import Network.BitTorrent.Exchange.Session as S
7 8
8import Config 9import Config
9 10
10 11
11nullLogger :: LogFun 12nullLogger :: LogFun
12nullLogger _ _ _ _ = return () 13nullLogger _ _ x _ = print x
13
14getMyAddr :: IO (PeerAddr (Maybe IP))
15getMyAddr = undefined
16 14
17spec :: Spec 15spec :: Spec
18spec = do 16spec = do
19 describe "metadata exchange" $ do 17 describe "metadata exchange" $ do
20 it "should fetch info dictionary" $ do 18 it "should fetch info dictionary" $ do
21 pending 19 withRemoteAddr $ \ addr -> do
22{- 20 Torrent {..} <- getTestTorrent
23 Torrent {..} <- getTestTorrent 21 myAddr <- getMyAddr
24 ses <- newSession nullLogger addr "" tInfoDict 22 ses <- newSession nullLogger myAddr "" tInfoDict
25 dict <- waitMetadata ses 23 S.insert addr ses
26 closeSession ses 24 dict <- waitMetadata ses
27 dict `shouldBe` tInfoDict 25 closeSession ses
28-} 26 dict `shouldBe` tInfoDict
29 27
30 it "should serve info dictionary" $ do 28 it "should serve info dictionary" $ do
31 pending 29 pending