diff options
Diffstat (limited to 'Biz/Que/Host.hs')
| -rwxr-xr-x | Biz/Que/Host.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Biz/Que/Host.hs b/Biz/Que/Host.hs index 34b1a01..8d826b4 100755 --- a/Biz/Que/Host.hs +++ b/Biz/Que/Host.hs @@ -33,8 +33,8 @@ import qualified Control.Exception as Exception import Data.HashMap.Lazy (HashMap) import qualified Data.HashMap.Lazy as HashMap import Network.HTTP.Media ((//), (/:)) -import qualified Network.Wai.Handler.Warp as Warp import Network.Socket (SockAddr (..)) +import qualified Network.Wai.Handler.Warp as Warp import qualified Omni.Cli as Cli import qualified Omni.Log as Log import Omni.Test ((@=?)) @@ -84,7 +84,7 @@ test = st <- atomically <| STM.newTVar mempty let cfg = Envy.defConfig let handlers = paths cfg - + -- Case 1: No auth, should fail let nonLocalHost = SockAddrInet 0 0 let handler1 = putQue handlers nonLocalHost Nothing "_" "testq" "body" @@ -92,7 +92,7 @@ test = case res1 of Left err -> if errHTTPCode err == 401 then pure () else Test.assertFailure ("Expected 401, got " <> show err) Right _ -> Test.assertFailure "Expected failure, got success" - + -- Case 2: Correct auth, should succeed let handler2 = putQue handlers nonLocalHost (Just "admin-key") "_" "testq" "body" res2 <- Servant.runHandler (runReaderT handler2 st) |
