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

Function bases

__tests__/python-generic-bases.test.ts:192–197  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

190
191 /** Names of the classes `name` in app/leaves.py extends. */
192 const bases = (name: string): string[] => {
193 const node = cg.getNodesInFile('app/leaves.py').find((n) => n.name === name && n.kind === 'class')!;
194 expect(node, name).toBeDefined();
195 return cg.getOutgoingEdges(node.id).filter((e) => e.kind === 'extends')
196 .map((e) => cg.getNode(e.target)!.name).sort();
197 };
198
199 it.skipIf(skip)('links Base[str], Base[list[int]] and Pair[str, dict[str, int]] like a plain base', () => {
200 expect(bases('Plain')).toEqual(['Base']);

Callers 1

Calls 4

mapMethod · 0.80
getNodeMethod · 0.80
getNodesInFileMethod · 0.65
getOutgoingEdgesMethod · 0.45

Tested by

no test coverage detected