(self)
| 168 | |
| 169 | class 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() |
no test coverage detected