Add requestHandler field to Request
This commit is contained in:
+2
-2
@@ -21,7 +21,7 @@ import Test.Hspec
|
||||
import Test.Hspec.Hedgehog
|
||||
|
||||
fakeRequest :: Request
|
||||
fakeRequest = Request (sec 0) utc nil
|
||||
fakeRequest = Request (sec 0) utc nil "test"
|
||||
|
||||
sec :: Integer -> UTCTime
|
||||
sec n = UTCTime (toEnum 0) (fromIntegral n)
|
||||
@@ -42,7 +42,7 @@ runTimed m = go (runMealy m id)
|
||||
where
|
||||
go _ [] = []
|
||||
go w ((s, a) : as) =
|
||||
case runIdentity (stepAuto w (Request (sec s) utc nil) a) of
|
||||
case runIdentity (stepAuto w (Request (sec s) utc nil "test") a) of
|
||||
(b, w') -> b : go w' as
|
||||
|
||||
-- | A minimal State monad for observing effectful arrows (e.g. whenA gating).
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ spec = describe "Bus" $ do
|
||||
r2 `shouldBe` (Event (Number 1), Event (Number 2))
|
||||
|
||||
it "channelHassEval writes CallService to the outbound channel" $ withTestBus $ \bus -> do
|
||||
let req = Request (UTCTime (toEnum 0) 0) utc nil
|
||||
let req = Request (UTCTime (toEnum 0) 0) utc nil "test"
|
||||
svc = Service "light" "turn_on" Nothing [EntityId "light.bedroom_masse"]
|
||||
runKatipContextT (busLogEnv bus) () (Namespace ["test"]) $
|
||||
channelHassEval bus (CallService req svc)
|
||||
|
||||
@@ -47,7 +47,7 @@ spec = do
|
||||
|
||||
req :: Int -> Request
|
||||
req n = Request (UTCTime (toEnum 0) (fromIntegral (0 :: Int))) utc
|
||||
(fromJust (fromString uuid))
|
||||
(fromJust (fromString uuid)) "test"
|
||||
where
|
||||
pad i = replicate (12 - length (show i)) '0' <> show i
|
||||
uuid = "00000000-0000-0000-0000-" <> pad n
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ import AFRP (Mealy (..), Request (..), stepAuto)
|
||||
import HomeAssistant.Controller (HASSEff (..), Service)
|
||||
|
||||
fakeRequest :: Request
|
||||
fakeRequest = Request (sec 0) utc nil
|
||||
fakeRequest = Request (sec 0) utc nil "test"
|
||||
|
||||
sec :: Integer -> UTCTime
|
||||
sec n = UTCTime (toEnum 0) (fromIntegral n)
|
||||
|
||||
Reference in New Issue
Block a user