{-# LANGUAGE OverloadedStrings #-} module ResourceTests where -- import Network.HTTP.Types -- import Test.Tasty -- import Test.Tasty.HUnit -- import Webcrank -- runResourceTests = testGroup "runResource" -- [ testCase "service is unavailable" testServiceUnavailable -- , testCase "not implemented" testNotImplemented -- , testCase "uri too long" testUriTooLong -- , testCase "method not allowed" testMethodNotAllowed -- , testCase "bad request" testBadRequest -- , testCase "unauthorized" testUnauthorized -- , testCase "forbidden" testForbidden -- , testCase "unknown or unsupported Content-* headers" testInvalidContentHeaders -- , testCase "unknown Content-Type" testUnknownContentType -- , testCase "entity too large" testEntityTooLarge -- , testCase "OPTIONS" testOptions -- , testCase "no acceptable media type" testNoAcceptableMediaType -- , testCase "no acceptable charset" testNoAcceptableCharset -- ] -- (<@=?>) = (=<<) . (@=?) -- testServiceUnavailable = resp503 <@=?> runResource rs testRq where -- rs = testResource { serviceAvailable = value False } -- resp503 = testResp serviceUnavailable503 -- [(hContentType, "text/html")] -- (testBody "