Browse Source

Add a test, remove superfluous file

tags/v0.2.2.0
Peter J. Jones 4 years ago
parent
commit
e81eba0b81

+ 9
- 1
src/Network/API/TheMovieDB.hs View File

@@ -66,5 +66,13 @@ module Network.API.TheMovieDB
, episodeStillURLs
) where

import Network.API.TheMovieDB.Types
--------------------------------------------------------------------------------
import Network.API.TheMovieDB.Actions
import Network.API.TheMovieDB.Internal.Configuration
import Network.API.TheMovieDB.Internal.TheMovieDB
import Network.API.TheMovieDB.Internal.Types
import Network.API.TheMovieDB.Types.Episode
import Network.API.TheMovieDB.Types.Genre
import Network.API.TheMovieDB.Types.Movie
import Network.API.TheMovieDB.Types.Season
import Network.API.TheMovieDB.Types.TV

+ 5
- 1
src/Network/API/TheMovieDB/Actions.hs View File

@@ -25,9 +25,13 @@ module Network.API.TheMovieDB.Actions
--------------------------------------------------------------------------------
import Control.Applicative
import Data.Text (Text)
import Network.API.TheMovieDB.Internal.Configuration
import Network.API.TheMovieDB.Internal.SearchResults
import Network.API.TheMovieDB.Internal.TheMovieDB
import Network.API.TheMovieDB.Types
import Network.API.TheMovieDB.Internal.Types
import Network.API.TheMovieDB.Types.Movie
import Network.API.TheMovieDB.Types.Season
import Network.API.TheMovieDB.Types.TV

--------------------------------------------------------------------------------
-- | Search TheMovieDB using the given query string.

+ 0
- 40
src/Network/API/TheMovieDB/Types.hs View File

@@ -1,40 +0,0 @@
{-

This file is part of the Haskell package themoviedb. It is subject to
the license terms in the LICENSE file found in the top-level directory
of this distribution and at git://pmade.com/themoviedb/LICENSE. No
part of themoviedb package, including this file, may be copied,
modified, propagated, or distributed except according to the terms
contained in the LICENSE file.

-}

--------------------------------------------------------------------------------
module Network.API.TheMovieDB.Types
( TheMovieDB
, ItemID
, Key
, Error (..)
, Genre (..)
, Movie (..)
, TV (..)
, Season (..)
, Episode (..)
, Configuration (..)
, moviePosterURLs
, tvPosterURLs
, seasonPosterURLs
, episodeStillURLs
, runTheMovieDB
, runTheMovieDBWithManager
) where

--------------------------------------------------------------------------------
import Network.API.TheMovieDB.Internal.Configuration
import Network.API.TheMovieDB.Internal.TheMovieDB
import Network.API.TheMovieDB.Internal.Types
import Network.API.TheMovieDB.Types.Episode
import Network.API.TheMovieDB.Types.Genre
import Network.API.TheMovieDB.Types.Movie
import Network.API.TheMovieDB.Types.Season
import Network.API.TheMovieDB.Types.TV

+ 13
- 0
test/TVTest.hs View File

@@ -43,6 +43,18 @@ testFetchSeason = do
season <- fakeTMDB "test/season-good.json" (fetchTVSeason 0 0)
assertEqual "length" 14 (length $ seasonEpisodes season)

--------------------------------------------------------------------------------
testSeasonPoster :: Assertion
testSeasonPoster = do
cfg <- fakeTMDB "test/config-good.json" config
season <- fakeTMDB "test/season-good.json" (fetchTVSeason 0 0)

let expect = "http://cf2.imgobject.com/t/p/w92/2dxsbVMoxsYH0Pta2mbFjF7mhHr.jpg"
urls = seasonPosterURLs cfg season

assertEqual "length" 6 (length urls)
assertEqual "poster" expect (head urls)

--------------------------------------------------------------------------------
testTVPoster :: Assertion
testTVPoster = do
@@ -61,5 +73,6 @@ tests = testGroup "TV"
[ testCase "Search fields" testSearchTV
, testCase "Fetch fields" testFetchTV
, testCase "Season fields" testFetchSeason
, testCase "Season Poster" testSeasonPoster
, testCase "TV Poster" testTVPoster
]

+ 0
- 1
themoviedb.cabal View File

@@ -47,7 +47,6 @@ library
Network.API.TheMovieDB.Internal.SearchResults
Network.API.TheMovieDB.Internal.TheMovieDB
Network.API.TheMovieDB.Internal.Types
Network.API.TheMovieDB.Types
Network.API.TheMovieDB.Types.Episode
Network.API.TheMovieDB.Types.Genre
Network.API.TheMovieDB.Types.Movie

Loading…
Cancel
Save