summaryrefslogtreecommitdiff
path: root/tests/Network/BitTorrent/Exchange/SessionSpec.hs
blob: 9f6f11a1a46da1f6d66f8447ef205a33b9f93cba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
module Network.BitTorrent.Exchange.SessionSpec (spec) where
import Test.Hspec

import Data.Torrent
import Network.BitTorrent.Core
import Network.BitTorrent.Exchange.Session

import Config


nullLogger :: LogFun
nullLogger _ _ _ _ = return ()

getMyAddr :: IO (PeerAddr (Maybe IP))
getMyAddr = undefined

spec :: Spec
spec = do
  describe "metadata exchange" $ do
    it "should fetch info dictionary" $ do
      pending
{-
      Torrent {..} <- getTestTorrent
      ses  <- newSession nullLogger addr "" tInfoDict
      dict <- waitMetadata ses
      closeSession ses
      dict `shouldBe` tInfoDict
-}

    it "should serve info dictionary" $ do
      pending

  describe "content exchange" $ do
    it "should fetch torrent content" $ do
      pending

    it "should serve torrent content" $ do
      pending