def test_get_dictionary_methods(self, test_paths): myIo = IoAdapter() dictContainerList = myIo.readFile(inputFilePath=str(test_paths['pathPdbxDictFile'])) mU = MethodUtils(dictContainerList=dictContainerList) mU.dumpMethods(fh=sys.stdout) mD = mU.getMethods() assert len(mD) == 5
def testGetDictionaryMethods(self): """Test case - dump methods for dictionary metadata""" try: myIo = IoAdapter(self.__verbose, self.__lfh) dictContainerList = myIo.readFile(inputFilePath=self.__pathPdbxDictFile) mU = MethodUtils(dictContainerList=dictContainerList, verbose=self.__verbose) mU.dumpMethods(fh=self.__lfh) # mD = mU.getMethods() self.assertEqual(len(mD), 5) except Exception as e: logger.exception("Failing with %s", str(e)) self.fail()
def test_invoke_dictionary_methods(self, test_paths): myIo = IoAdapter() dictContainerList = myIo.readFile(inputFilePath=str(test_paths['pathPdbxDictFile'])) mU = MethodUtils(dictContainerList=dictContainerList) dataContainerList = myIo.readFile(inputFilePath=str(test_paths['pathPdbxDataFile'])) mU.setDataContainerList(dataContainerList=dataContainerList) mU.invokeMethods() print("Write data file after invoking methods") dataContainerList = mU.getDataContainerList() ok = myIo.writeFile(outputFilePath=str(test_paths['pathOutFile']), containerList=dataContainerList) assert ok
def testInvokeDictionaryMethods(self): """Test case - invoke dictionary methods -""" try: myIo = IoAdapter(self.__verbose, self.__lfh) dictContainerList = myIo.readFile(inputFilePath=self.__pathPdbxDictFile) dataContainerList = myIo.readFile(inputFilePath=self.__pathPdbxDataFile) # mU = MethodUtils(dictContainerList=dictContainerList, verbose=self.__verbose) mU.setDataContainerList(dataContainerList=dataContainerList) mU.invokeMethods() logger.debug("Write data file after invoking methods") dataContainerList = mU.getDataContainerList() ok = myIo.writeFile(outputFilePath=self.__pathOutFile, containerList=dataContainerList) # self.assertEqual(ok, True) except Exception as e: logger.exception("Failing with %s", str(e)) self.fail()