def testModulestoreImportExportHashInfo(self): testFilePath = os.path.join(os.path.dirname(__file__), 'data/modulestore_sample.json') pickleFilePath = os.path.join(os.path.dirname(__file__), 'data/modulestore_sample.pkl') importer = ModulestoreImporter(testFilePath, pickleCachePath=pickleFilePath) dest = tempfile.NamedTemporaryFile(prefix='oolala', suffix='.csv') importer.exportHashInfo(dest, addHeader=True) truthFile = open(os.path.join(os.path.dirname(__file__),'data/modulestore_sampleTruth.csv'),'r') if UPDATE_TRUTH: self.updateTruth(dest.name, truthFile.name) else: self.assertFileContentEquals(truthFile, dest.name) dest.close()