Module Expr Str Import alias Import alias ImportFrom alias Import alias identifier Import alias identifier ImportFrom alias alias alias alias alias ImportFrom alias ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr Call NameLoad Assign AttributeStore AttributeLoad AttributeLoad NameLoad attr attr attr Num Assign AttributeStore AttributeLoad AttributeLoad NameLoad attr attr attr Num Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str Num Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str Num Str decorator_list Call AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Dict Str Dict Str Str Str Str Num Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str Num Str decorator_list Call AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Dict Str Dict Str Str Str Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list Call AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str Num Str Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr ListLoad Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str With Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Str NameStore body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str With Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Str NameStore body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str With Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Str NameStore body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr Num Assign NameStore Dict Str Str Str Str Num Num NameLoad Str Assign NameStore ListLoad Str Str Str Str Assign NameStore Call AttributeLoad NameLoad attr keyword Num keyword NameLoad With Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Str NameStore body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad Assign NameStore Call AttributeLoad SubscriptLoad SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Index Num Index Num attr Str Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Call NameLoad NameLoad decorator_list Call AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr Num Assign NameStore ListLoad Str Str Assign NameStore Call AttributeLoad NameLoad attr keyword Str keyword Dict Str Num With Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Str NameStore body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad Assign NameStore Call AttributeLoad SubscriptLoad SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Index Num Index Num attr Str Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Call NameLoad NameLoad decorator_list Call AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad Dict Str Num With Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Str NameStore body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad Assign NameStore ListLoad Str Str Assign NameStore Call AttributeLoad SubscriptLoad SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Index Num Index Num attr Str Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Call NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad With Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Str NameStore body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad Assign NameStore ListLoad Str Str Assign NameStore Call AttributeLoad SubscriptLoad SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Index Num Index Num attr Str Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Call NameLoad NameLoad decorator_list Call AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad Dict Str Num With Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Str NameStore body Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad decorator_list Call AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad Str Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad Str attr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad Str attr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list Call AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam defaults body Expr Str With Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Str NameStore body Assign AttributeStore AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword Dict Str Str Str Call AttributeLoad NameLoad attr FunctionDef arguments args defaults body If CompareGtE Call NameLoad NameLoad Num body Return AttributeLoad AttributeLoad NameLoad attr attr orelse If NameLoad body Expr Call AttributeLoad NameLoad attr Num Return Call AttributeLoad NameLoad attr keyword Str keyword Dict Str NameLoad orelse Expr Call AttributeLoad NameLoad attr Num Return NameLoad decorator_list With Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Str NameStore body With Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Str NameStore body Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Num AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str SubscriptLoad AttributeLoad NameLoad attr Index Str decorator_list decorator_list
N/A N/A The tests for the Graphite component. N/A socket N/A unittest unittest mock N/A homeassistant.core ha N/A homeassistant.components.graphite graphite homeassistant.const EVENT_STATE_CHANGED EVENT_HOMEASSISTANT_START EVENT_HOMEASSISTANT_STOP STATE_ON STATE_OFF tests.common get_test_home_assistant TestGraphite N/A N/A unittest TestCase N/A N/A Test the Graphite component. setup_method N/A N/A self method N/A N/A N/A Setup things to be run when tests are started. N/A N/A self hass N/A get_test_home_assistant N/A N/A N/A N/A self hass config latitude 32.87336 N/A N/A N/A N/A self hass config longitude 117.22743 N/A N/A self gf N/A N/A graphite GraphiteFeeder N/A self hass foo 123 ha N/A teardown_method N/A N/A self method N/A N/A N/A Stop everything that was started. N/A N/A N/A N/A self hass stop N/A test_minimal_config N/A N/A self mock_gf N/A N/A N/A Test setup with minimal configuration. N/A N/A N/A self assertTrue N/A N/A graphite setup N/A self hass N/A N/A N/A N/A mock_gf assert_called_once_with N/A self hass localhost 2003 ha N/A N/A N/A mock patch homeassistant.components.graphite.GraphiteFeeder test_full_config N/A N/A self mock_gf N/A N/A N/A Test setup with full configuration. N/A config N/A graphite N/A host port prefix foo 123 me N/A N/A N/A self assertTrue N/A N/A graphite setup N/A self hass config N/A N/A N/A mock_gf assert_called_once_with N/A self hass foo 123 me N/A N/A N/A mock patch homeassistant.components.graphite.GraphiteFeeder test_config_bad_port N/A N/A self mock_gf N/A N/A N/A Test setup with invalid port. N/A config N/A graphite N/A host port foo wrong N/A N/A N/A self assertFalse N/A N/A graphite setup N/A self hass config N/A N/A N/A self assertFalse N/A mock_gf called N/A N/A N/A mock patch homeassistant.components.graphite.GraphiteFeeder test_subscribe N/A N/A self N/A N/A N/A Test the subscription. N/A fake_hass N/A N/A mock MagicMock N/A gf N/A N/A graphite GraphiteFeeder fake_hass foo 123 ha N/A N/A N/A N/A N/A fake_hass bus listen_once has_calls N/A N/A N/A mock call EVENT_HOMEASSISTANT_START N/A gf start_listen N/A N/A mock call EVENT_HOMEASSISTANT_STOP N/A gf shutdown N/A N/A N/A N/A N/A fake_hass bus listen assert_called_once_with EVENT_STATE_CHANGED N/A gf event_listener N/A test_start N/A N/A self N/A N/A N/A Test the start. N/A N/A N/A N/A mock patch object N/A self gf start mock_start N/A N/A N/A N/A N/A self gf start_listen event N/A N/A N/A mock_start assert_called_once_with N/A test_shutdown N/A N/A self N/A N/A N/A Test the shutdown. N/A N/A N/A N/A mock patch object N/A self gf _queue mock_queue N/A N/A N/A N/A N/A self gf shutdown event N/A N/A N/A N/A mock_queue put assert_called_once_with N/A N/A self gf _quit_object N/A test_event_listener N/A N/A self N/A N/A N/A Test the event listener. N/A N/A N/A N/A mock patch object N/A self gf _queue mock_queue N/A N/A N/A N/A N/A self gf event_listener foo N/A N/A N/A N/A mock_queue put assert_called_once_with foo N/A test_report_attributes N/A N/A self mock_time N/A N/A N/A Test the reporting with attributes. N/A N/A mock_time return_value 12345 N/A attrs N/A foo bar baz bat 1 2.0 True NaN N/A expected N/A ha.entity.state 0.000000 12345 ha.entity.foo 1.000000 12345 ha.entity.bar 2.000000 12345 ha.entity.baz 1.000000 12345 N/A state N/A N/A mock MagicMock state 0 attributes attrs N/A N/A N/A N/A mock patch object N/A self gf _send_to_graphite mock_send N/A N/A N/A N/A N/A self gf _report_attributes entity state N/A actual N/A N/A N/A N/A N/A N/A mock_send call_args_list N/A 0 N/A 0 N/A 0 split N/A N/A N/A self assertEqual N/A sorted expected N/A sorted actual N/A N/A N/A mock patch time.time test_report_with_string_state N/A N/A self mock_time N/A N/A N/A Test the reporting with strings. N/A N/A mock_time return_value 12345 N/A expected N/A ha.entity.foo 1.000000 12345 ha.entity.state 1.000000 12345 N/A state N/A N/A mock MagicMock state above_horizon attributes N/A foo 1.0 N/A N/A N/A N/A mock patch object N/A self gf _send_to_graphite mock_send N/A N/A N/A N/A N/A self gf _report_attributes entity state N/A actual N/A N/A N/A N/A N/A N/A mock_send call_args_list N/A 0 N/A 0 N/A 0 split N/A N/A N/A self assertEqual N/A sorted expected N/A sorted actual N/A N/A N/A mock patch time.time test_report_with_binary_state N/A N/A self mock_time N/A N/A N/A Test the reporting with binary state. N/A N/A mock_time return_value 12345 N/A state N/A N/A ha State domain.entity STATE_ON N/A foo 1.0 N/A N/A N/A N/A mock patch object N/A self gf _send_to_graphite mock_send N/A N/A N/A N/A N/A self gf _report_attributes entity state N/A expected N/A ha.entity.foo 1.000000 12345 ha.entity.state 1.000000 12345 N/A actual N/A N/A N/A N/A N/A N/A mock_send call_args_list N/A 0 N/A 0 N/A 0 split N/A N/A N/A self assertEqual N/A sorted expected N/A sorted actual N/A N/A state state STATE_OFF N/A N/A N/A N/A mock patch object N/A self gf _send_to_graphite mock_send N/A N/A N/A N/A N/A self gf _report_attributes entity state N/A expected N/A ha.entity.foo 1.000000 12345 ha.entity.state 0.000000 12345 N/A actual N/A N/A N/A N/A N/A N/A mock_send call_args_list N/A 0 N/A 0 N/A 0 split N/A N/A N/A self assertEqual N/A sorted expected N/A sorted actual N/A N/A N/A mock patch time.time test_send_to_graphite_errors N/A N/A self mock_time N/A N/A N/A Test the sending with errors. N/A N/A mock_time return_value 12345 N/A state N/A N/A ha State domain.entity STATE_ON N/A foo 1.0 N/A N/A N/A N/A mock patch object N/A self gf _send_to_graphite mock_send N/A N/A N/A mock_send side_effect N/A socket error N/A N/A N/A N/A self gf _report_attributes entity state N/A N/A mock_send side_effect N/A socket gaierror N/A N/A N/A N/A self gf _report_attributes entity state N/A N/A N/A mock patch time.time test_send_to_graphite N/A N/A self mock_socket N/A N/A N/A Test the sending of data. N/A N/A N/A N/A self gf _send_to_graphite foo N/A N/A N/A mock_socket assert_called_once_with N/A socket AF_INET N/A socket SOCK_STREAM N/A sock N/A mock_socket return_value N/A N/A N/A N/A sock connect assert_called_once_with N/A foo 123 N/A N/A N/A N/A sock sendall assert_called_once_with N/A N/A foo encode ascii N/A N/A N/A N/A sock send assert_called_once_with N/A N/A encode ascii N/A N/A N/A N/A sock close assert_called_once_with N/A N/A N/A mock patch socket.socket test_run_stops N/A N/A self N/A N/A N/A Test the stops. N/A N/A N/A N/A mock patch object N/A self gf _queue mock_queue N/A N/A N/A N/A mock_queue get return_value N/A N/A self gf _quit_object N/A N/A N/A self assertEqual None N/A N/A N/A self gf run N/A N/A N/A N/A mock_queue get assert_called_once_with N/A N/A N/A N/A mock_queue task_done assert_called_once_with N/A test_run N/A N/A self N/A N/A N/A Test the running. N/A runs N/A N/A event N/A N/A mock MagicMock event_type EVENT_STATE_CHANGED data N/A entity_id new_state entity N/A N/A mock MagicMock fake_get N/A N/A N/A N/A N/A N/A N/A len runs 2 N/A N/A N/A N/A self gf _quit_object N/A N/A runs N/A N/A N/A N/A runs append 1 N/A N/A N/A mock MagicMock event_type somethingelse data N/A new_event None N/A N/A N/A N/A runs append 1 N/A event N/A N/A N/A N/A N/A mock patch object N/A self gf _queue mock_queue N/A N/A N/A N/A N/A mock patch object N/A self gf _report_attributes mock_r N/A N/A N/A N/A mock_queue get side_effect fake_get N/A N/A N/A N/A self gf run N/A N/A N/A self assertEqual 3 N/A N/A mock_queue task_done call_count N/A N/A N/A mock_r assert_called_once_with entity N/A N/A event data N/A new_state N/A N/A