Uses the provided patching function to update the contents of all files. `patch_fn` takes the current contents of a file as input and returns the new contents.
(self, patch_fn: Callable[[bytes], bytes])
| 131 | self._files[name] = importlib.resources.read_binary(__package__, name) |
| 132 | |
| 133 | def patch_files(self, patch_fn: Callable[[bytes], bytes]) -> None: |
| 134 | """Uses the provided patching function to update the contents of all |
| 135 | files. `patch_fn` takes the current contents of a file as input and |
| 136 | returns the new contents. |
| 137 | """ |
| 138 | for name in self._files.keys(): |
| 139 | self._files[name] = patch_fn(self._files[name]) |
| 140 | |
| 141 | def get(self, name: str) -> bytes: |
| 142 | """Returns the current contents of the named file.""" |