MCPcopy Create free account
hub / github.com/FastLED/FastLED / create_test_file

Method create_test_file

ci/tests/test_fingerprint_cache.py:52–63  ·  view source on GitHub ↗

Create a test file with specific content and optional modification time.

(
        self, path: Path, content: str, modtime: Optional[float] = None
    )

Source from the content-addressed store, hash-verified

50 shutil.rmtree(self.test_dir, ignore_errors=True)
51
52 def create_test_file(
53 self, path: Path, content: str, modtime: Optional[float] = None
54 ) -> Path:
55 """Create a test file with specific content and optional modification time."""
56 with open(path, "w") as f:
57 f.write(content)
58
59 if modtime:
60 # Set specific modification time
61 os.utime(path, (modtime, modtime))
62
63 return path
64
65 def touch_file(self, path: Path) -> float:
66 """Touch a file to update its modification time without changing content."""

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected