#NEWLINE# @ patch . object ( dockerng_mod , '_get_exec_driver' ) #NEWLINE# def test_check_mine_cache_is_refreshed_on_container_change_event( self , _ ) : #NEWLINE# #INDENT# '\n        Every command that might modify docker containers state.\n        Should trig an update on ``mine.send``\n        ' #NEWLINE# for ( command_name , args ) in ( ( 'create' , ( ) ) , ( 'rm_' , ( ) ) , ( 'kill' , ( ) ) , ( 'pause' , ( ) ) , ( 'signal_' , ( 'KILL' , ) ) , ( 'start' , ( ) ) , ( 'stop' , ( ) ) , ( 'unpause' , ( ) ) , ( '_run' , ( 'command' , ) ) , ( '_script' , ( 'command' , ) ) ) : #NEWLINE# #INDENT# mine_send = Mock ( ) #NEWLINE# command = getattr ( dockerng_mod , command_name ) #NEWLINE# docker_client = MagicMock ( ) #NEWLINE# docker_client . api_version = '1.12' #NEWLINE# with patch . dict ( dockerng_mod . __salt__ , { #NEWLINE# #INDENT# 'mine.send' : mine_send , #NEWLINE# 'container_resource.run' : MagicMock ( ) , #NEWLINE# 'cp.cache_file' : MagicMock ( return_value = False ) , #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# with patch . dict ( dockerng_mod . __context__ , { #NEWLINE# #INDENT# 'docker.client' : docker_client , #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# command ( 'container' , * args ) #NEWLINE# #UNINDENT# #UNINDENT# mine_send . assert_called_with ( 'dockerng.ps' , verbose = True , all = True , host = True )