File tree Expand file tree Collapse file tree 2 files changed +18
-5
lines changed
Famix-Python-Importer-Tests Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -3205,6 +3205,21 @@ FamixPythonProject1Test >> testInvocationToUnknowEntityOfSameNameAsUnknowPackage
32053205 self assert: unknowFunction isStub
32063206]
32073207
3208+ { #category : 'tests' }
3209+ FamixPythonProject1Test >> testInvocationToUnknowEntityOfSameNameAsUnknowPackage2 [
3210+ " Regression test"
3211+
3212+ | unknowFunction |
3213+ " I get the one without children to have the bottom most entity of this name since it should be in an entity of the same name."
3214+ unknowFunction := self model entities detect: [ :entity |
3215+ entity class = FamixPythonUnknownEntity and: [ entity name = 'variable_scope' and: [ entity childEntities isEmpty ] ] ].
3216+
3217+ self assert: unknowFunction name equals: 'variable_scope'.
3218+ self assert: unknowFunction parentPackage name equals: 'variable_scope'.
3219+ self deny: unknowFunction identicalTo: unknowFunction parentPackage.
3220+ self assert: unknowFunction isStub
3221+ ]
3222+
32083223{ #category : 'tests - invocations' }
32093224FamixPythonProject1Test >> testInvocationsThatCannotBeResolved [
32103225 " I created a file with a lot of invocations that cannot be resolved and we will ensure we do not create any invocation for them."
Original file line number Diff line number Diff line change @@ -350,7 +350,8 @@ FamixPythonVisitor >> manageAttributeAsCallReceiver: aNode [
350350 expectedKind: {
351351 FamixPythonFunction .
352352 FamixPythonClass };
353- notFoundReplacementEntity: [ :unresolved :currentEntity | " This one can be a function or a class"
353+ notFoundReplacementEntity: [ :unresolved :currentEntity |
354+ " This one can be a function or a class"
354355 (self ensureStubUnknownEntityNamed: unresolved identifier)
355356 parentPackage: import importedEntity;
356357 yourself ];
@@ -363,10 +364,7 @@ FamixPythonVisitor >> manageAttributeAsCallReceiver: aNode [
363364 ifFound: [ :import |
364365 ^ self
365366 resolve: ((FamixPythonDependencyFromImportedEntityResolvable identifier: identifier import: import)
366- notFoundReplacementEntity: [ :unresolved :currentEntity |
367- (self ensureStubUnknownEntityNamed: unresolved identifier)
368- parentPackage: unresolved import importedEntity;
369- yourself ];
367+ notFoundReplacementEntity: [ :unresolved :currentEntity | self ensureStubUnknownEntityNamed: unresolved identifier in: unresolved import importedEntity ];
370368 yourself )
371369 foundAction: [ :result :currentEntity | self createAssociationsForFunctionCallNode: (aNode parentOfType: #call ) forResult: result in: currentEntity ] ].
372370
You can’t perform that action at this time.
0 commit comments