#NEWLINE# @ mock . patch ( 'homeassistant.components.binary_sensor.nx584.NX584Watcher' ) #NEWLINE# @ mock . patch ( 'homeassistant.components.binary_sensor.nx584.NX584ZoneSensor' ) #NEWLINE# def test_setup_full_config( self , mock_nx , mock_watcher ) : #NEWLINE# #INDENT# 'Test the setup with full configuration.' #NEWLINE# config = { #NEWLINE# #INDENT# 'host' : 'foo:123' , #NEWLINE# 'exclude_zones' : [ 2 ] , #NEWLINE# 'zone_types' : { #NEWLINE# #INDENT# 3 : 'motion' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# add_devices = mock . MagicMock ( ) #NEWLINE# hass = mock . MagicMock ( ) #NEWLINE# self . assertTrue ( nx584 . setup_platform ( mock_nx , config , add_devices ) ) #NEWLINE# mock_nx . assert_has_calls ( [ mock . call ( self . fake_zones [ 0 ] , 'opening' ) , mock . call ( self . fake_zones [ 2 ] , 'motion' ) ] ) #NEWLINE# self . assertTrue ( add_devices . called ) #NEWLINE# nx584_client . Client . assert_called_once_with ( 'http://foo:123' ) #NEWLINE# self . assertTrue ( mock_watcher . called )