<s> import os , tempfile , unittest <EOL> from conary . repository . filecontents import FromFile <EOL> class FileContentsTest ( unittest . TestCase ) : <EOL> def testFile ( self ) : <EOL> ( fd , name ) = tempfile . mkstemp ( ) <EOL> os . close ( fd ) <EOL> try : <EOL> f = open ( name , "<STR_LIT:w>" ) <EOL> f . write ( "<STR_LIT:hello>" ) <EOL> f . close ( ) <EOL> f = open ( name , "<STR_LIT:r>" ) <EOL> fc = FromFile ( f ) <EOL> assert ( fc . get ( ) . read ( ) == "<STR_LIT:hello>" ) <EOL> assert ( fc . get ( ) . read ( ) == "<STR_LIT:hello>" ) <EOL> finally : <EOL> os . unlink ( name ) </s>
