def add_default_stores(amap): sql = SQLStorageConfiguration() amap['sqlite'] = { 'type': 'sql', 'config': sql.create_sqlstorage_config() } mongo = MongoStorageConfiguration() amap['mongo'] = { 'type': 'mongo', 'config': mongo.create_mongostorage_config() } redis = RedisStorageConfiguration() amap['redis'] = { 'type': 'redis', 'config': redis.create_redisstorage_config() } file = FileStorageConfiguration() amap['file'] = { 'type': 'file', 'config': file.create_filestorage_config() } logger = LoggerStorageConfiguration() amap['logger'] = { 'type': 'logger', 'config': logger.create_loggerstorage_config() }
def test_create_loggerstorage_config(self): yaml = YamlConfigurationFile() self.assertIsNotNone(yaml) yaml.load_from_text( """ logger: type: logger config: conversation_logger: conversations """, ConsoleConfiguration(), ".") logger_config = yaml.get_section("logger") config = LoggerStorageConfiguration() config.load_config_section(yaml, logger_config, ".") self.assertEquals({'conversation_logger': 'conversations'}, config.create_loggerstorage_config())