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

Function resolves

__tests__/python-attr-chain.test.ts:401–407  ·  view source on GitHub ↗
(svc: string, fn = 'go')

Source from the content-addressed store, hash-verified

399 const FOO = 'class Foo:\n def m(self):\n return 1\n';
400 const OTHER = 'class Other:\n def m(self):\n return 2\n';
401 const resolves = async (svc: string, fn = 'go') => {
402 write('foo.py', FOO);
403 write('other.py', OTHER);
404 write('svc.py', svc);
405 cg = await CodeGraph.init(tempDir, { index: true });
406 return callsFrom('method', fn).filter((c) => c.startsWith('method:m@'));
407 };
408
409 it('a keyword argument passing a parameter through is not a rebinding', async () => {
410 expect(await resolves('from foo import Foo\n\nclass Base:\n def __init__(self, client=None):\n pass\n\nclass Svc(Base):\n def __init__(self, client: Foo):\n super().__init__(\n client=client,\n )\n validate(client=client)\n self.client = client\n\n def go(self):\n return self.client.m()\n\ndef validate(client=None):\n return client\n'))

Callers 1

Calls 3

writeFunction · 0.70
callsFromFunction · 0.70
initMethod · 0.45

Tested by

no test coverage detected