Пример #1
0
    def test_put(self):
        config = Parameters(self)

        config.put(None, 123)
        assert 0 == len(config)

        config.put("field1", 123)
        assert 1 == len(config)
        assert 123 == config.get("field1")

        config.put("field2", "ABC")
        assert 2 == len(config)
        assert "ABC" == config.get("field2")

        config.put("field2.field1", 123)
        assert "ABC" == config.get("field2")

        config.put("field3.field31", 456)
        assert 3 == len(config)
        sub_config = config.get_as_map("field3")
        assert None != sub_config
        assert 456 == sub_config.get("field31")

        config.put("field3.field32", "XYZ")
        assert "XYZ" == config.get("field3.field32")
 def handler(correlation_id: Optional[str], args: Parameters):
     entity = args.get("dummy")
     if isinstance(entity, dict):
         entity = Dummy.from_json(entity)
     return self._controller.update(correlation_id, entity)
 def handler(correlation_id: Optional[str], args: Parameters):
     filter = FilterParams.from_value(args.get("filter"))
     paging = PagingParams.from_value(args.get("paging"))
     page = self._controller.get_page_by_filter(correlation_id, filter,
                                                paging)
     return page