#NEWLINE# def testMkstempDir( self ) : #NEWLINE# #INDENT# 'test tempfile.mkstemp(dir=).' #NEWLINE# self . assertRaises ( OSError , self . tempfile . mkstemp , dir = '/dir' ) #NEWLINE# self . filesystem . CreateDirectory ( '/dir' ) #NEWLINE# next_fd = len ( self . filesystem . open_files ) #NEWLINE# temporary = self . tempfile . mkstemp ( dir = '/dir' ) #NEWLINE# self . assertEqual ( 2 , len ( temporary ) ) #NEWLINE# self . assertEqual ( next_fd , temporary [ 0 ] ) #NEWLINE# self . assertTrue ( temporary [ 1 ] . startswith ( '/dir/tmp' ) ) #NEWLINE# created_filenames = self . tempfile . FakeReturnedMktempValues ( ) #NEWLINE# self . assertEqual ( temporary [ 1 ] , created_filenames [ 0 ] ) #NEWLINE# self . assertTrue ( self . filesystem . Exists ( temporary [ 1 ] ) ) #NEWLINE# self . assertEqual ( self . filesystem . GetObject ( temporary [ 1 ] ) . st_mode , ( stat . S_IFREG | 384 ) )