1{-# LANGUAGE OverloadedStrings #-}
5import qualified Data.Text as T
7import System.Environment
10import Test.Tasty.QuickCheck
13----------------------------------------------------------------------
14withQuickCheckDepth :: TestName -> Int -> [TestTree] -> TestTree
15withQuickCheckDepth tn depth tests =
16 localOption (QuickCheckTests depth) (testGroup tn tests)
18----------------------------------------------------------------------
19onlineTestsIfEnabled :: IO [TestTree]
20onlineTestsIfEnabled = do
21 apiKey <- (return . fmap T.pack) =<< lookupEnv "MANDRILL_API_KEY"
25 testGroup "Mandrill online tests" [
26 testCase "users/info.json" (testOnlineUsersInfo k)
27 , testCase "users/ping2.json" (testOnlineUsersPing2 k)
28 , testCase "users/senders.json" (testOnlineUsersSenders k)
29 , testCase "messages/send.json" (testOnlineMessagesSend k)
30 , testCase "inbound/addDomain.json" (testOnlineDomainAdd k)
31 , testCase "inbound/addRoute.json" (testOnlineRouteAdd k)
34----------------------------------------------------------------------
37 onlineTests <- onlineTestsIfEnabled
38 defaultMainWithIngredients defaultIngredients $
39 testGroup "Mandrill tests" $ onlineTests <> [
40 testGroup "Mandrill offline tests" [
41 testCase "users/info.json API parsing" testUsersInfo
42 , testCase "users/senders.json API parsing" testUsersSenders
43 , testCase "messages/send.json API parsing" testMessagesSend
44 , testCase "messages/send.json API response parsing" testMessagesResponseRejected
45 , testCase "inbound/add-route.json API response parsing" testRouteAdd
46 , testCase "inbound/add-domain.json API response parsing" testDomainAdd
47 , testCase "senders/verify-domain.json API response parsing" testVerifyDomain
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list