MCPcopy
hub / github.com/mitmproxy/mitmproxy / setdefault

Method setdefault

test/mitmproxy/proxy/tutils.py:414–419  ·  view source on GitHub ↗
(self, value: AnyStr)

Source from the content-addressed store, hash-verified

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

nothing calls this directly

Calls 1

setdefaultMethod · 0.45

Tested by

no test coverage detected