#NEWLINE# def test_process_network_devices( self ) : #NEWLINE# #INDENT# agent = self . agent #NEWLINE# device_info = { #NEWLINE# #INDENT# 'current' : set ( ) , #NEWLINE# 'added' : set ( [ 'mac3' , 'mac4' ] ) , #NEWLINE# 'updated' : set ( [ 'mac2' , 'mac3' ] ) , #NEWLINE# 'removed' : set ( [ 'mac1' ] ) , #NEWLINE# #UNINDENT# } #NEWLINE# agent . sg_agent . prepare_devices_filter = mock . Mock ( ) #NEWLINE# agent . sg_agent . refresh_firewall = mock . Mock ( ) #NEWLINE# agent . treat_devices_added_updated = mock . Mock ( return_value = False ) #NEWLINE# agent . treat_devices_removed = mock . Mock ( return_value = False ) #NEWLINE# agent . process_network_devices ( device_info ) #NEWLINE# agent . sg_agent . prepare_devices_filter . assert_called_with ( set ( [ 'mac3' , 'mac4' ] ) ) #NEWLINE# self . assertTrue ( device_info . sg_agent . refresh_firewall . called ) #NEWLINE# agent . treat_devices_added_updated . assert_called_with ( set ( [ 'mac2' , 'mac3' , 'mac4' ] ) ) #NEWLINE# agent . treat_devices_removed . assert_called_with ( set ( [ 'mac1' ] ) )