def test_existingFile(self): cnfgHdl = ConfigHandler('tmp/config.txt') self.assertEqual(True, cnfgHdl.optionFileFound())
print( str(datetime.datetime.now()) + ' : ' + str(userId) + ' >>>\n' + text + '\n<<<\n') # ------------------------------------------------------------------------------ # Main program createDirectory('log') createDirectory('cnfg') m_debugLogger = DebugLogger() m_doorStats = [] m_cnfgHdl = ConfigHandler('cnfg/config.txt', m_debugLogger) if False == m_cnfgHdl.optionFileFound(): m_debugLogger.logText('Config file not found (cnfg/config.txt)') else: m_telegramId = readTelegramId() m_userAccessList = UserListHandler(m_debugLogger) m_userAccessList.initialize('./cnfg/registeredIds.txt') m_userAccessList.loadList() #m_userAccessList.printList() m_userNotificationList = UserListHandler(m_debugLogger) m_userNotificationList.initialize('./cnfg/notificationIds.txt') m_userNotificationList.loadList() #m_userNotificationList.printList()
def test_missingFile(self): cnfgHdl = ConfigHandler('tmp/config_not_exist.txt') self.assertEqual(False, cnfgHdl.optionFileFound())