def fn4(i, putOnDiskArraysInJsonSqg=False): """Write and then re-read the sqg in a temporary file """ sqg, graph = i tempFile = getTempFile(rootDir=os.getcwd()) self.tempFiles.append(tempFile) writeJsonSqgFile(sqg, tempFile, putOnDiskArraysInJsonSqg=putOnDiskArraysInJsonSqg) sqg = readJsonSqgFile(tempFile) return sqg, graph
def testJsonReadAndWriteSqg(self): for include in self.jsonFiles: logger.info("Going to use jsonRead to parse/write/parse SQG %s" % include) #First read file = os.path.join(getPysqgIncludeDir(), include + ".json") sqg = readJsonSqgFile(file) #Then write writeJsonSqgFile(sqg, self.tempFile) #Now parse again readJsonSqgFile(self.tempFile)