Module Expr Str Import alias Import alias ImportFrom alias alias Import alias identifier ImportFrom alias ImportFrom alias ImportFrom alias Import alias identifier ImportFrom alias alias alias alias alias ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr Assign AttributeStore NameLoad attr Call NameLoad Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Assign NameStore Dict If NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad If NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad Return Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr Str NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr Str Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr keyword NameLoad Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad NameLoad decorator_list Call NameLoad Str FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Assign NameStore Str Assign NameStore Str Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr keyword NameLoad Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Expr Call AttributeLoad NameLoad attr Expr Call NameLoad AttributeLoad NameLoad attr Call NameLoad NameLoad Str Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Index Num Assign NameStore Dict Assign SubscriptStore NameLoad Index Str NameLoad Assign NameStore Dict Str Str Str Str Str Call AttributeLoad NameLoad attr Str NameLoad Dict Call AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Str Dict Str Str NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list Call NameLoad Str Call NameLoad Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Expr Call AttributeLoad NameLoad attr Expr Call NameLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list Call NameLoad Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr keyword NameLoad Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Assign NameStore ListLoad Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str Lambda arguments args NameParam defaults Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Assign NameStore Call AttributeLoad NameLoad attr Dict Str Str Str Dict keyword NameLoad Expr Call NameLoad AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Expr Call AttributeLoad NameLoad attr Num Call NameLoad NameLoad decorator_list decorator_list
N/A N/A The tests for the MQTT eventstream component. N/A json N/A unittest unittest.mock ANY patch N/A homeassistant.components.mqtt_eventstream eventstream homeassistant.const EVENT_STATE_CHANGED homeassistant.core State homeassistant.remote JSONEncoder N/A homeassistant.util.dt dt_util tests.common get_test_home_assistant mock_mqtt_component fire_mqtt_message mock_state_change_event fire_time_changed TestMqttEventStream N/A N/A unittest TestCase N/A N/A Test the MQTT eventstream module. setUp N/A N/A self N/A N/A N/A Setup things to be run when tests are started. N/A N/A N/A N/A super TestMqttEventStream self setUp N/A N/A self hass N/A get_test_home_assistant N/A N/A self mock_mqtt N/A mock_mqtt_component N/A self hass N/A tearDown N/A N/A self N/A N/A N/A Stop everything that was started. N/A N/A N/A N/A self hass stop N/A add_eventstream N/A N/A self sub_topic pub_topic N/A None None N/A N/A Add a mqtt_eventstream component. N/A config N/A N/A sub_topic N/A N/A N/A config N/A subscribe_topic sub_topic N/A pub_topic N/A N/A N/A config N/A publish_topic pub_topic N/A N/A N/A eventstream setup N/A self hass N/A N/A eventstream DOMAIN config N/A test_setup_succeeds N/A N/A self N/A N/A N/A "Test the success of the setup. N/A N/A N/A self assertTrue N/A N/A self add_eventstream N/A test_setup_with_pub N/A N/A self N/A N/A N/A "Test the setup with subscription. N/A N/A N/A self assertEqual N/A N/A N/A N/A N/A self hass bus listeners get * None N/A N/A N/A self assertTrue N/A N/A self add_eventstream pub_topic bar N/A N/A N/A N/A N/A self hass pool block_till_done N/A N/A N/A self assertEqual N/A N/A N/A N/A N/A self hass bus listeners get * 1 N/A test_subscribe N/A N/A self mock_sub N/A N/A N/A "Test the subscription. N/A sub_topic foo N/A N/A N/A self assertTrue N/A N/A self add_eventstream sub_topic sub_topic N/A N/A N/A N/A N/A self hass pool block_till_done N/A N/A N/A mock_sub assert_called_with N/A self hass sub_topic ANY N/A N/A patch homeassistant.components.mqtt.subscribe test_state_changed_event_sends_message N/A N/A self mock_utcnow mock_pub N/A N/A N/A "Test the sending of a new message if event changed. N/A now N/A N/A dt_util as_utc N/A N/A dt_util now N/A e_id fake.entity N/A pub_topic bar N/A N/A mock_utcnow return_value now N/A N/A N/A self assertTrue N/A N/A self add_eventstream pub_topic pub_topic N/A N/A N/A N/A N/A self hass pool block_till_done N/A N/A N/A mock_pub reset_mock N/A N/A mock_state_change_event N/A self hass N/A State e_id on N/A N/A N/A N/A N/A self hass pool block_till_done N/A N/A N/A mock_pub assert_called_with N/A self hass pub_topic ANY N/A N/A N/A self assertTrue N/A mock_pub called N/A msg N/A N/A N/A mock_pub call_args N/A 0 N/A 2 N/A event N/A N/A N/A event N/A event_type EVENT_STATE_CHANGED N/A new_state N/A last_updated state entity_id attributes last_changed N/A N/A now isoformat on e_id N/A N/A N/A now isoformat N/A N/A event N/A event_data N/A new_state entity_id new_state e_id N/A N/A N/A self assertEqual N/A N/A json loads msg event N/A N/A patch homeassistant.components.mqtt.publish N/A patch homeassistant.core.dt_util.utcnow test_time_event_does_not_send_message N/A N/A self mock_pub N/A N/A N/A "Test the sending of a new message if time event. N/A N/A N/A self assertTrue N/A N/A self add_eventstream pub_topic bar N/A N/A N/A N/A N/A self hass pool block_till_done N/A N/A N/A mock_pub reset_mock N/A N/A fire_time_changed N/A self hass N/A N/A dt_util utcnow N/A N/A N/A self assertFalse N/A mock_pub called N/A N/A patch homeassistant.components.mqtt.publish test_receiving_remote_event_fires_hass_event N/A N/A self N/A N/A N/A "Test the receiving of the remotely fired event. N/A sub_topic foo N/A N/A N/A self assertTrue N/A N/A self add_eventstream sub_topic sub_topic N/A N/A N/A N/A N/A self hass pool block_till_done N/A calls N/A N/A N/A N/A N/A N/A self hass bus listen_once test_event N/A N/A N/A _ N/A N/A N/A calls append 1 N/A N/A N/A N/A N/A self hass pool block_till_done N/A payload N/A N/A json dumps N/A event_type event_data test_event N/A cls JSONEncoder N/A N/A fire_mqtt_message N/A self hass sub_topic payload N/A N/A N/A N/A N/A self hass pool block_till_done N/A N/A N/A self assertEqual 1 N/A len calls N/A N/A