#NEWLINE# @ mock . patch . object ( nx584 . NX584ZoneSensor , 'update_ha_state' ) #NEWLINE# def test_process_zone_event( self , mock_update ) : #NEWLINE# #INDENT# 'Test the processing of zone events.' #NEWLINE# zone1 = { #NEWLINE# #INDENT# 'number' : 1 , #NEWLINE# 'name' : 'foo' , #NEWLINE# 'state' : True , #NEWLINE# #UNINDENT# } #NEWLINE# zone2 = { #NEWLINE# #INDENT# 'number' : 2 , #NEWLINE# 'name' : 'bar' , #NEWLINE# 'state' : True , #NEWLINE# #UNINDENT# } #NEWLINE# zones = { #NEWLINE# #INDENT# 1 : nx584 . NX584ZoneSensor ( zone1 , 'motion' ) , #NEWLINE# 2 : nx584 . NX584ZoneSensor ( zone2 , 'motion' ) , #NEWLINE# #UNINDENT# } #NEWLINE# watcher = nx584 . NX584Watcher ( None , zones ) #NEWLINE# watcher . _process_zone_event ( { #NEWLINE# #INDENT# 'zone' : 1 , #NEWLINE# 'zone_state' : False , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertFalse ( mock_update [ 'state' ] ) #NEWLINE# self . assertEqual ( 1 , mock_update . call_count )