MCPcopy Create free account
hub / github.com/tox-dev/filelock / create

Method create

tests/soft/read_write/test_participant_model.py:280–286  ·  view source on GitHub ↗
(self, path: str, data: bytes, *, durable: bool = False)

Source from the content-addressed store, hash-verified

278
279 @override
280 def create(self, path: str, data: bytes, *, durable: bool = False) -> tuple[int, int]: # ruff:ignore[unused-method-argument] # memory has no storage to flush
281 self._scheduler.yield_turn()
282 if _key(path) in self.files: # pragma: no cover # every name created here is a fresh token
283 raise FileExistsError(path)
284 self.files[_key(path)] = data
285 self._record()
286 return 0, 0
287
288 @override
289 def overwrite(self, path: str, data: bytes, identity: tuple[int, int], header: bytes) -> bool: # ruff:ignore[unused-method-argument] # nothing here swaps one file for another

Calls 3

_recordMethod · 0.95
_keyFunction · 0.85
yield_turnMethod · 0.80

Tested by

no test coverage detected