Simplify channelHassEval now that the writer owns the flag decision
This commit is contained in:
+3
-2
@@ -43,14 +43,15 @@ spec = describe "Bus" $ do
|
||||
(_, svc') <- atomically $ readTChan (busOutbound bus)
|
||||
svc' `shouldBe` svc
|
||||
|
||||
it "channelHassEval drops CallService when the handler is disabled" $
|
||||
it "channelHassEval writes CallService to the outbound channel even when the handler is disabled" $
|
||||
withTestFlagsBus $ \bus -> do
|
||||
setEnabled (busFlags bus) "test-handler" False
|
||||
let req = Request (UTCTime (toEnum 0) 0) utc nil "test-handler"
|
||||
svc = Service "light" "turn_on" Nothing [EntityId "light.test"]
|
||||
runKatipContextT (busLogEnv bus) () (Namespace ["test"]) $
|
||||
channelHassEval bus (CallService req svc)
|
||||
atomically (isEmptyTChan (busOutbound bus)) `shouldReturn` True
|
||||
(_, svc') <- atomically $ readTChan (busOutbound bus)
|
||||
svc' `shouldBe` svc
|
||||
|
||||
|
||||
it "generates unique sequential call ids" $ do
|
||||
|
||||
Reference in New Issue
Block a user