MCPcopy
hub / github.com/pallets/werkzeug / build

Method build

src/werkzeug/routing/rules.py:839–853  ·  src/werkzeug/routing/rules.py::Rule.build

Assembles the relative url for that rule and the subdomain. If building doesn't work for some reasons `None` is returned. :internal:

(
        self, values: t.Mapping[str, t.Any], append_unknown: bool = True
    )

Source from the content-addressed store, hash-verified

837 return self._get_func_code(code, func_ast.name)
838
839 def build(
840 self, values: t.Mapping[str, t.Any], append_unknown: bool = True
841 ) -> tuple[str, str] | None:
842 class="st">"""Assembles the relative url for that rule and the subdomain.
843 If building doesn&class="cm">#x27;t work for some reasons `None` is returned.
844
845 :internal:
846 class="st">"""
847 try:
848 if append_unknown:
849 return self._build_unknown(**values)
850 else:
851 return self._build(**values)
852 except ValidationError:
853 return None
854
855 def provides_defaults_for(self, rule: Rule) -> bool:
856 class="st">"""Check if this rule has defaults for a given rule.

Callers 15

test_merge_slashes_buildFunction · 0.45
test_basic_buildingFunction · 0.45
test_long_buildFunction · 0.45
test_defaultsFunction · 0.45
test_greedyFunction · 0.45
test_non_string_partsFunction · 0.45
test_build_values_dictFunction · 0.45

Calls

no outgoing calls

Tested by 15

test_merge_slashes_buildFunction · 0.36
test_basic_buildingFunction · 0.36
test_long_buildFunction · 0.36
test_defaultsFunction · 0.36
test_greedyFunction · 0.36
test_non_string_partsFunction · 0.36
test_build_values_dictFunction · 0.36