#NEWLINE# def test_run( self ) : #NEWLINE# #INDENT# MockCmd = mock . MagicMock ( ) #NEWLINE# MockCmd . needs_project_config . return_value = False #NEWLINE# mock_cmd = mock_cmd . return_value #NEWLINE# with mock . patch ( 'os.chdir' ) , mock . patch ( 'sys.argv' , new = [ '/DUMMY.py' , 'dummy1' , 'dummy2' ] ) , mock . patch ( 'googkit.lib.path.project_root' , return_value = '/dir1/dir2' ) , mock . patch ( 'googkit.Help' ) , mock . patch ( 'googkit.Environment' , return_value = 'dummy_env' ) , mock . patch ( 'googkit.CommandTree' ) as MockTree , mock . patch ( 'googkit.lib.plugin.load' ) as mock_load , mock . patch ( 'logging.basicConfig' ) : #NEWLINE# #INDENT# MockTree . return_value . command_class . return_value = MockCmd #NEWLINE# googkit . main ( ) #NEWLINE# #UNINDENT# mock_load . assert_called_once_with ( MockTree . return_value ) #NEWLINE# mock_cmd . run . assert_called_once_with ( )