#NEWLINE# def testReadResultFromAlternateDir( self ) : #NEWLINE# #INDENT# context = StorageOnlyContext ( ) #NEWLINE# otherdir = os . path . join ( encoder_configuration . conf . sysdir ( ) , 'otherdir' ) #NEWLINE# cache = encoder . EncodingDiskCache ( context ) #NEWLINE# my_encoder = encoder . Encoder ( context , encoder . OptionValueSet ( encoder . OptionSet ( ) , '--parameters' ) ) #NEWLINE# cache . StoreEncoder ( my_encoder ) #NEWLINE# videofile = encoder . Videofile ( 'x/foo_640_480_20.yuv' ) #NEWLINE# my_encoding = encoder . Encoding ( my_encoder , 123 , videofile ) #NEWLINE# testresult = { #NEWLINE# #INDENT# 'foo' : 'bar' , #NEWLINE# #UNINDENT# } #NEWLINE# my_encoding . result = testresult #NEWLINE# cache . StoreEncoding ( my_encoding ) #NEWLINE# my_encoding . result = None #NEWLINE# result = cache . ReadEncodingResult ( my_encoding , scoredir = otherdir ) #NEWLINE# self . assertIsNone ( result ) #NEWLINE# shutil . copytree ( encoder_configuration . conf . workdir ( ) , otherdir ) #NEWLINE# result = cache . ReadEncodingResult ( my_encoding , scoredir = otherdir ) #NEWLINE# self . assertEquals ( result , testresult )