def set_config(self, config: ValueExtractor) -> None:
     cfg = config.connection
     dsn: URI = cfg.get_uri("dsn").with_auth(
         username=cfg.get("username"),
         password=cfg.get("password"),
     )
     super().set_config(config.new_child(dsn=dsn))
示例#2
0
def test_value_extractor_order_keys():
    v = ValueExtractor(MergeDict(a=1))
    assert list(v.new_child(b=1)) == ['a', 'b']
    assert list(v.new_parent(b=1)) == ['a', 'b']
    assert list(v.new_parent(b=1).new_child(c=1)) == ['a', 'b', 'c']