#NEWLINE# def test_expands_home_directory( self , monkeypatch ) : #NEWLINE# #INDENT# path = '~/test-random-0123' #NEWLINE# expanded_path = gocd_cli . utils . expand_user ( path ) #NEWLINE# monkeypatch . setattr ( os . path , 'isfile' , ( lambda p : ( True if ( p == expanded_path ) else False ) ) ) #NEWLINE# monkeypatch . setattr ( os , 'access' , ( lambda p , _ : ( True if ( p == expanded_path ) else False ) ) ) #NEWLINE# assert gocd_cli . utils . is_file_readable ( expanded_path )