MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / fixture

Function fixture

__tests__/sync-python-import-binding-retry.test.ts:400–412  ·  view source on GitHub ↗

600 failed calls of `FastAPI` parked under 'module:fastapi', and 600 of `get` under their name.

()

Source from the content-addressed store, hash-verified

398
399 /** 600 failed calls of `FastAPI` parked under 'module:fastapi', and 600 of `get` under their name. */
400 function fixture(): QueryBuilder {
401 db = DatabaseConnection.initialize(path.join(tempRoot(), 'test.db'));
402 const queries = new QueryBuilder(db.getDb());
403 queries.insertNode({ id: 'f', kind: 'file', name: 'app.py', qualifiedName: 'app.py', filePath: 'app.py',
404 language: 'python', startLine: 1, endLine: 1, startColumn: 0, endColumn: 0, updatedAt: 0 });
405 const refs = Array.from({ length: 1200 }, (_, i) => ({
406 fromNodeId: 'f', referenceName: i < 600 ? 'FastAPI' : 'get', referenceKind: 'calls' as const,
407 line: i + 1, column: 0, filePath: 'app.py', language: 'python' as const,
408 }));
409 queries.insertUnresolvedRefsBatch(refs);
410 db.getDb().exec("UPDATE unresolved_refs SET status = 'failed', name_tail = CASE reference_name WHEN 'FastAPI' THEN 'module:fastapi' ELSE 'get' END");
411 return queries;
412 }
413
414 it('lets every importer of a package that appeared retry, and still skips a common name', () => {
415 const queries = fixture();

Calls 8

insertNodeMethod · 0.95
getDbMethod · 0.80
fromMethod · 0.80
tempRootFunction · 0.70
execMethod · 0.65
initializeMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected