MCPcopy
hub / github.com/mitmproxy/mitmproxy / _AnyStrPlaceholder

Class _AnyStrPlaceholder

test/mitmproxy/proxy/tutils.py:409–419  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

407
408
409class _AnyStrPlaceholder(_Placeholder[AnyStr]):
410 def __init__(self, match: AnyStr):
411 super().__init__(type(match))
412 self._match = match
413
414 def setdefault(self, value: AnyStr) -> AnyStr:
415 if self._obj is None:
416 super().setdefault(value)
417 if not re.search(self._match, self._obj, re.DOTALL): # type: ignore
418 raise ValueError(f"{self._obj!r} does not match {self._match!r}.")
419 return self._obj
420
421
422# noinspection PyPep8Naming

Callers 2

BytesMatchingFunction · 0.85
StrMatchingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…