#NEWLINE# def test_is_cached_success( self ) : #NEWLINE# #INDENT# '\n        Test if is_cached succeeds.\n        ' #NEWLINE# path = 'salt://saltines' #NEWLINE# ret = path #NEWLINE# class MockFileClient ( object ) : #NEWLINE# #INDENT# def is_cached( self , path , saltenv ) : #NEWLINE# #INDENT# return path #NEWLINE# #UNINDENT# #UNINDENT# mock_file_client = MockFileClient ( ) #NEWLINE# with patch . dict ( cp . __context__ , { #NEWLINE# #INDENT# 'cp.fileclient' : mock_file_client , #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# self . assertEqual ( cp . is_cached ( path ) , ret )