diff options
author | Sam Truzjan <pxqr.sta@gmail.com> | 2014-02-26 08:01:00 +0400 |
---|---|---|
committer | Sam Truzjan <pxqr.sta@gmail.com> | 2014-02-26 08:01:00 +0400 |
commit | b3599a62f92a52a3ee2704e1143b65151e4e3142 (patch) | |
tree | c5d6593a033a62804198147545bc4d0fad5366af | |
parent | 8526ebaa230d98f70654e6bcfc64dcd511712f7b (diff) |
Add initial exchange session spec
-rw-r--r-- | bittorrent.cabal | 1 | ||||
-rw-r--r-- | tests/Network/BitTorrent/Exchange/SessionSpec.hs | 38 |
2 files changed, 39 insertions, 0 deletions
diff --git a/bittorrent.cabal b/bittorrent.cabal index 1562fdac..cc45e4c6 100644 --- a/bittorrent.cabal +++ b/bittorrent.cabal | |||
@@ -210,6 +210,7 @@ test-suite spec | |||
210 | Network.BitTorrent.Tracker.RPC.UDPSpec | 210 | Network.BitTorrent.Tracker.RPC.UDPSpec |
211 | Network.BitTorrent.Tracker.SessionSpec | 211 | Network.BitTorrent.Tracker.SessionSpec |
212 | Network.BitTorrent.Exchange.MessageSpec | 212 | Network.BitTorrent.Exchange.MessageSpec |
213 | Network.BitTorrent.Exchange.SessionSpec | ||
213 | Network.BitTorrent.Exchange.Session.MetadataSpec | 214 | Network.BitTorrent.Exchange.Session.MetadataSpec |
214 | Network.BitTorrent.Exchange.WireSpec | 215 | Network.BitTorrent.Exchange.WireSpec |
215 | System.Torrent.StorageSpec | 216 | System.Torrent.StorageSpec |
diff --git a/tests/Network/BitTorrent/Exchange/SessionSpec.hs b/tests/Network/BitTorrent/Exchange/SessionSpec.hs new file mode 100644 index 00000000..9f6f11a1 --- /dev/null +++ b/tests/Network/BitTorrent/Exchange/SessionSpec.hs | |||
@@ -0,0 +1,38 @@ | |||
1 | module Network.BitTorrent.Exchange.SessionSpec (spec) where | ||
2 | import Test.Hspec | ||
3 | |||
4 | import Data.Torrent | ||
5 | import Network.BitTorrent.Core | ||
6 | import Network.BitTorrent.Exchange.Session | ||
7 | |||
8 | import Config | ||
9 | |||
10 | |||
11 | nullLogger :: LogFun | ||
12 | nullLogger _ _ _ _ = return () | ||
13 | |||
14 | getMyAddr :: IO (PeerAddr (Maybe IP)) | ||
15 | getMyAddr = undefined | ||
16 | |||
17 | spec :: Spec | ||
18 | spec = do | ||
19 | describe "metadata exchange" $ do | ||
20 | it "should fetch info dictionary" $ do | ||
21 | pending | ||
22 | {- | ||
23 | Torrent {..} <- getTestTorrent | ||
24 | ses <- newSession nullLogger addr "" tInfoDict | ||
25 | dict <- waitMetadata ses | ||
26 | closeSession ses | ||
27 | dict `shouldBe` tInfoDict | ||
28 | -} | ||
29 | |||
30 | it "should serve info dictionary" $ do | ||
31 | pending | ||
32 | |||
33 | describe "content exchange" $ do | ||
34 | it "should fetch torrent content" $ do | ||
35 | pending | ||
36 | |||
37 | it "should serve torrent content" $ do | ||
38 | pending | ||