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

Method _add_file_from_data

src/werkzeug/test.py:429–438  ·  view source on GitHub ↗

Called in the EnvironBuilder to add files from the data dict.

(
        self,
        key: str,
        value: (t.IO[bytes] | tuple[t.IO[bytes], str] | tuple[t.IO[bytes], str, str]),
    )

Source from the content-addressed store, hash-verified

427 return cls(**out)
428
429 def _add_file_from_data(
430 self,
431 key: str,
432 value: (t.IO[bytes] | tuple[t.IO[bytes], str] | tuple[t.IO[bytes], str, str]),
433 ) -> None:
434 """Called in the EnvironBuilder to add files from the data dict."""
435 if isinstance(value, tuple):
436 self.files.add_file(key, *value)
437 else:
438 self.files.add_file(key, value)
439
440 @staticmethod
441 def _make_base_url(scheme: str, host: str, script_root: str) -> str:

Callers 1

__init__Method · 0.95

Calls 1

add_fileMethod · 0.80

Tested by

no test coverage detected