def __prepareData(self): #prepare the test data dictionary = CMDB_Dictionary() dictionary.key = 'AMD 2' dictionary.key_type = 'CPU_TYPE' dictionary.value = 'AMD 2 CPU' dictionary.flag = True dictionary.gmtCreated = 'DalDictionaryTest' return dictionary
def __initDictionary(self): DictionaryList = ( ['CPU_TYPE',['AMD','INTEL']], ['IP_TYPE',['VIP','IP']], ['RAID',['SSD','SATA']], ['PATITION_TYPE',['SYSTEM','USER']], ['ENV',['PRD','PAT','TESTA','TESTB','TESTC','DEV']], ['APP',['HADES','AEGIS','DUBBO','NAPOLI']], ['APP_TYPE',['APACHE','TOMCAT','DATABASE']], ) for keyType in DictionaryList: for key in keyType[1]: dictionary = CMDB_Dictionary() dictionary.key_type = keyType[0] dictionary.key = key DictionaryManager().insertDictionaryInfo(dictionary)