#NEWLINE# def test_runner( self , mock ) : #NEWLINE# #INDENT# '\n        Test if it execute a runner on the master and return the data\n        from the runner function\n        ' #NEWLINE# ret = 'No access to master. If using salt-call with --local, please remove.' #NEWLINE# self . assertEqual ( publish . runner ( 'manage.down' ) , mock ) #NEWLINE# mock = MagicMock ( return_value = True ) #NEWLINE# mock_id = MagicMock ( return_value = 'salt_id' ) #NEWLINE# with patch . dict ( publish . __opts__ , { #NEWLINE# #INDENT# 'master_uri' : mock , #NEWLINE# 'id' : mock_id , #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# Channel . flag = 0 #NEWLINE# self . assertTrue ( publish . runner ( 'manage.down' ) ) #NEWLINE# Channel . flag = 1 #NEWLINE# self . assertEqual ( publish . runner ( 'manage.down' ) , "'manage.down' runner publish timed out" )