def load_default_dynamic_maps(self, dynamics_configuration): if PluralMap.NAME not in self._dynamic_maps: YLogger.warning( self, "Dynamic set %s not defined, adding default implementation", PluralMap.NAME) self._dynamic_maps[PluralMap.NAME] = PluralMap( dynamics_configuration) if SingularMap.NAME not in self._dynamic_maps: YLogger.warning( self, "Dynamic set %s not defined, adding default implementation", SingularMap.NAME) self._dynamic_maps[SingularMap.NAME] = SingularMap( dynamics_configuration) if SuccessorMap.NAME not in self._dynamic_maps: YLogger.warning( self, "Dynamic set %s not defined, adding default implementation", SuccessorMap.NAME) self._dynamic_maps[SuccessorMap.NAME] = SuccessorMap( dynamics_configuration) if PredecessorMap.NAME not in self._dynamic_maps: YLogger.warning( self, "Dynamic set %s not defined, adding default implementation", PredecessorMap.NAME) self._dynamic_maps[PredecessorMap.NAME] = PredecessorMap( dynamics_configuration)
def load_default_dynamic_maps(self, dynamics_configuration): if PluralMap.NAME not in self._dynamic_maps: if logging.getLogger().isEnabledFor(logging.WARNING): logging.warning("Dynamic set %s not defined, adding default implementation"%PluralMap.NAME) self._dynamic_maps[PluralMap.NAME] = PluralMap(dynamics_configuration) if SingularMap.NAME not in self._dynamic_maps: if logging.getLogger().isEnabledFor(logging.WARNING): logging.warning("Dynamic set %s not defined, adding default implementation"%SingularMap.NAME) self._dynamic_maps[SingularMap.NAME] = SingularMap(dynamics_configuration) if SuccessorMap.NAME not in self._dynamic_maps: if logging.getLogger().isEnabledFor(logging.WARNING): logging.warning("Dynamic set %s not defined, adding default implementation"%SuccessorMap.NAME) self._dynamic_maps[SuccessorMap.NAME] = SuccessorMap(dynamics_configuration) if PredecessorMap.NAME not in self._dynamic_maps: if logging.getLogger().isEnabledFor(logging.WARNING): logging.warning("Dynamic set %s not defined, adding default implementation"%PredecessorMap.NAME) self._dynamic_maps[PredecessorMap.NAME] = PredecessorMap(dynamics_configuration)
def test_plural_no_match(self): map = SingularMap(None) self.assertEqual("FISH", map.map_value(self._client_context, "FISH"))
def test_plural_s_to_singular(self): map = SingularMap(None) self.assertEqual("CURL", map.map_value(self._client_context, "CURLS"))
def test_plural_ies_to_singular(self): map = SingularMap(None) self.assertEqual("HOLLY", map.map_value(self._client_context, "HOLLIES"))
def test_static_map(self): map = SingularMap(None) self.assertEqual("MOUSE", map.map_value(self._client_context, "MICE"))
def test_static_map(self): map = SingularMap(None) self.assertEqual("MOUSE", map.map_value(None, "clientid", "MICE"))
def test_plural_no_match(self): map = SingularMap(None) self.assertEqual("FISH", map.map_value(None, "clientid", "FISH"))
def test_plural_s_to_singular(self): map = SingularMap(None) self.assertEqual("CURL", map.map_value(None, "clientid", "CURLS"))