MCPcopy Create free account
hub / github.com/ParzivalHack/PySpector / _make_entry

Method _make_entry

tests/unit/ast_cache_test.py:170–180  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

168
169class TestSerializeDeserialize(unittest.TestCase):
170 def _make_entry(self) -> FileCacheEntry:
171 src = "def foo(): pass\n"
172 tree = ast.parse(src)
173 full_json, chunks = _build_ast_json_and_chunks(tree, src, {})
174 return FileCacheEntry(
175 file_path="/tmp/test_file.py",
176 file_hash=hashlib.sha256(src.encode()).hexdigest(),
177 mtime=1234567890.0,
178 full_ast_json_z=zlib.compress(full_json.encode()),
179 chunks=chunks,
180 )
181
182 def test_roundtrip(self):
183 entry = self._make_entry()

Callers 2

test_roundtripMethod · 0.95

Calls 2

FileCacheEntryClass · 0.90

Tested by

no test coverage detected