Module Expr Str Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias identifier ClassDef bases NameLoad body Expr Str Pass decorator_list ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr ListLoad Dict Str Str Str Num Dict Str Str Str Num Dict Str Str Str Num Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign AttributeStore AttributeLoad NameLoad attr attr Str 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 body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Dict NameLoad Expr Call AttributeLoad NameLoad attr ListComp Call AttributeLoad NameLoad attr NameLoad Str comprehension NameStore AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str decorator_list Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Dict Str Str Str Str ListLoad Num Dict Num Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr ListLoad Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num Str Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad Dict Str ListLoad Str Dict Str Dict Str Str Dict Str Dict Num Str Dict Str Dict Str Str For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Dict decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr Str Expr Call AttributeLoad NameLoad attr Dict decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr ListLoad Assign NameStore NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Dict NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Dict Str Str Str Num Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Str NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Dict Str Str Str Num Str NameLoad Assign NameStore Dict Str Str Str Num Str NameLoad Assign NameStore Dict Num Num Call AttributeLoad NameLoad attr NameLoad Str Call AttributeLoad NameLoad attr NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Dict Str Str Num NameLoad Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr decorator_list Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Dict Expr Call AttributeLoad NameLoad attr Dict Str Str Num NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad Num Num FunctionDef arguments args defaults body Expr Str If NameLoad body Expr Call AttributeLoad NameLoad attr orelse Return NameLoad decorator_list Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore ListLoad Dict Str Str Str Num NameLoad Str Dict Str Str Num NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Dict FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num decorator_list Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str Expr Call NameLoad Expr Call AttributeLoad NameLoad attr Num AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore ListLoad Num Num FunctionDef arguments args defaults body If NameLoad body Expr Call AttributeLoad NameLoad attr Raise Call AttributeLoad AttributeLoad NameLoad attr attr orelse Raise Call NameLoad decorator_list Assign NameStore Call AttributeLoad NameLoad attr NameLoad Dict With Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str NameStore body Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr ListLoad Call AttributeLoad NameLoad attr Num Call AttributeLoad NameLoad attr Num decorator_list Call AttributeLoad NameLoad attr Str decorator_list
N/A N/A The tests for the nx584 sensor platform. N/A requests N/A unittest unittest mock homeassistant.components.binary_sensor nx584 nx584 client nx584_client StopMe N/A Exception N/A N/A Stop helper. N/A N/A TestNX584SensorSetup N/A N/A unittest TestCase N/A N/A Test the nx584 sensor platform. 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 self _mock_client N/A N/A N/A mock patch object nx584_client Client N/A N/A N/A N/A self _mock_client start N/A N/A self fake_zones N/A N/A name number front 1 N/A name number back 2 N/A name number inside 3 N/A client N/A N/A nx584_client Client return_value N/A N/A N/A client list_zones return_value N/A self fake_zones N/A N/A N/A client get_version return_value 1.1 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 _mock_client stop N/A test_setup_no_config N/A N/A self mock_nx mock_watcher N/A N/A N/A Test the setup with no configuration. N/A add_devices N/A N/A mock MagicMock N/A hass N/A N/A mock MagicMock N/A N/A N/A self assertTrue N/A N/A nx584 setup_platform hass N/A add_devices N/A N/A N/A mock_nx assert_has_calls N/A N/A N/A mock call zone opening N/A zone N/A self fake_zones N/A N/A N/A self assertTrue N/A add_devices called N/A N/A N/A N/A nx584_client Client assert_called_once_with http://localhost:5007 N/A N/A N/A mock patch homeassistant.components.binary_sensor.nx584.NX584Watcher N/A N/A mock patch homeassistant.components.binary_sensor.nx584.NX584ZoneSensor test_setup_full_config N/A N/A self mock_nx mock_watcher N/A N/A N/A Test the setup with full configuration. N/A config N/A host exclude_zones zone_types foo:123 N/A 2 N/A 3 motion N/A add_devices N/A N/A mock MagicMock N/A hass N/A N/A mock MagicMock N/A N/A N/A self assertTrue N/A N/A nx584 setup_platform hass config add_devices N/A N/A N/A mock_nx assert_has_calls N/A N/A N/A mock call N/A N/A self fake_zones N/A 0 opening N/A N/A mock call N/A N/A self fake_zones N/A 2 motion N/A N/A N/A self assertTrue N/A add_devices called N/A N/A N/A N/A nx584_client Client assert_called_once_with http://foo:123 N/A N/A N/A self assertTrue N/A mock_watcher called N/A N/A N/A mock patch homeassistant.components.binary_sensor.nx584.NX584Watcher N/A N/A mock patch homeassistant.components.binary_sensor.nx584.NX584ZoneSensor _test_assert_graceful_fail N/A N/A self config N/A N/A N/A Test the failing. N/A hass add_devices N/A N/A mock MagicMock N/A N/A N/A self assertFalse N/A N/A nx584 setup_platform hass config add_devices N/A N/A N/A self assertFalse N/A add_devices called N/A test_setup_bad_config N/A N/A self N/A N/A N/A Test the setup with bad configuration. N/A bad_configs N/A N/A exclude_zones N/A a N/A zone_types N/A a b N/A zone_types N/A 1 notatype N/A zone_types N/A notazone motion N/A config bad_configs N/A N/A N/A N/A self _test_assert_graceful_fail config N/A test_setup_connect_failed N/A N/A self N/A N/A N/A Test the setup with connection failure. N/A N/A N/A N/A N/A nx584_client Client return_value list_zones side_effect N/A N/A requests exceptions ConnectionError N/A N/A N/A self _test_assert_graceful_fail N/A N/A test_setup_version_too_old N/A N/A self N/A N/A N/A "Test if version is too old. N/A N/A N/A N/A N/A nx584_client Client return_value get_version return_value 1.0 N/A N/A N/A self _test_assert_graceful_fail N/A N/A test_setup_no_zones N/A N/A self N/A N/A N/A Test the setup with no zones. N/A N/A N/A N/A N/A nx584_client Client return_value list_zones return_value N/A N/A hass add_devices N/A N/A mock MagicMock N/A N/A N/A self assertTrue N/A N/A nx584 setup_platform hass N/A add_devices N/A N/A N/A self assertFalse N/A add_devices called N/A N/A TestNX584ZoneSensor N/A N/A unittest TestCase N/A N/A Test for the nx584 zone sensor. test_sensor_normal N/A N/A self N/A N/A N/A Test the sensor. N/A zone N/A number name state 1 foo True N/A sensor N/A N/A nx584 NX584ZoneSensor zone motion N/A N/A N/A self assertEqual foo N/A sensor name N/A N/A N/A self assertFalse N/A sensor should_poll N/A N/A N/A self assertTrue N/A sensor is_on N/A N/A zone N/A state False N/A N/A N/A self assertFalse N/A sensor is_on N/A N/A TestNX584Watcher N/A N/A unittest TestCase N/A N/A Test the nx584 watcher. test_process_zone_event N/A N/A self mock_update N/A N/A N/A Test the processing of zone events. N/A zone1 N/A number name state 1 foo True N/A zone2 N/A number name state 2 bar True N/A zones N/A 1 2 N/A N/A nx584 NX584ZoneSensor zone1 motion N/A N/A nx584 NX584ZoneSensor zone2 motion N/A watcher N/A N/A nx584 NX584Watcher None zones N/A N/A N/A watcher _process_zone_event N/A zone zone_state 1 False N/A N/A N/A self assertFalse N/A zone1 N/A state N/A N/A N/A self assertEqual 1 N/A mock_update call_count N/A N/A N/A N/A mock patch object N/A nx584 NX584ZoneSensor update_ha_state test_process_zone_event_missing_zone N/A N/A self mock_update N/A N/A N/A Test the processing of zone events with missing zones. N/A watcher N/A N/A nx584 NX584Watcher None N/A N/A N/A N/A watcher _process_zone_event N/A zone zone_state 1 False N/A N/A N/A self assertFalse N/A mock_update called N/A N/A N/A N/A mock patch object N/A nx584 NX584ZoneSensor update_ha_state test_run_with_zone_events N/A N/A self N/A N/A N/A Test the zone events. N/A empty_me N/A 1 2 fake_get_events N/A N/A N/A N/A N/A Return nothing twice, then some events. N/A empty_me N/A N/A N/A N/A empty_me pop N/A N/A fake_events N/A N/A client N/A N/A mock MagicMock N/A fake_events N/A N/A zone zone_state type 1 True zone_status N/A zone foo 2 False N/A N/A N/A client get_events side_effect fake_get_events N/A watcher N/A N/A nx584 NX584Watcher client N/A run N/A N/A fake_process N/A N/A N/A N/A fake_process side_effect StopMe N/A N/A N/A self assertRaises StopMe N/A watcher _run N/A N/A N/A fake_process assert_called_once_with N/A fake_events N/A 0 N/A N/A N/A N/A mock patch object watcher _process_zone_event N/A N/A run N/A N/A N/A self assertEqual 3 N/A N/A client get_events call_count N/A test_run_retries_failures N/A N/A self mock_sleep N/A N/A N/A Test the retries with failures. N/A empty_me N/A 1 2 fake_run N/A N/A N/A N/A N/A empty_me N/A N/A N/A N/A empty_me pop N/A N/A N/A N/A requests exceptions ConnectionError N/A N/A N/A StopMe N/A N/A watcher N/A N/A nx584 NX584Watcher None N/A N/A N/A N/A N/A mock patch object watcher _run mock_inner N/A N/A N/A mock_inner side_effect fake_run N/A N/A N/A self assertRaises StopMe N/A watcher run N/A N/A N/A self assertEqual 3 N/A mock_inner call_count N/A N/A N/A mock_sleep assert_has_calls N/A N/A N/A mock call 10 N/A N/A mock call 10 N/A N/A N/A mock patch time.sleep N/A