@@ -2327,8 +2327,6 @@ FamixPythonProject1Test >> testFunctionSourceAnchor [
23272327FamixPythonProject1Test >> testFunctionTypedDefaultParameter [
23282328
23292329 | function parameter |
2330- self skip.
2331- self flag: #todo. " Manage assertions on types."
23322330 function := self functionNamed: 'function_with_typed_default_parameter'.
23332331 parameter := self parameterNamed: 'default_typed_parameter'.
23342332
@@ -2340,14 +2338,32 @@ FamixPythonProject1Test >> testFunctionTypedDefaultParameter [
23402338 self assert: parameter parentBehaviouralEntity equals: function.
23412339 self assert: parameter hasDefaultValue.
23422340 self deny: parameter isListSplat.
2343- self deny: parameter isDictionarySplat
2341+ self deny: parameter isDictionarySplat.
2342+
2343+
2344+ self flag: #todo " Manage assertions on types."
23442345]
23452346
23462347{ #category : 'tests - parameters' }
23472348FamixPythonProject1Test >> testFunctionTypedParameter [
23482349
2349- self flag: #todo.
2350- self skip
2350+ | function parameter |
2351+ function := self functionNamed: 'function_with_typed_parameter'.
2352+ parameter := self parameterNamed: 'typed_parameter'.
2353+
2354+ self assert: function parameters size equals: 1.
2355+ self assert: function keywordSeparatorPosition equals: nil.
2356+ self assert: function positionalSeparatorPosition equals: nil.
2357+ self assertCollection: function parameters hasSameElements: { parameter }.
2358+ self assert: parameter name equals: 'typed_parameter'.
2359+ self deny: parameter isStub.
2360+ self assert: parameter class equals: FamixPythonParameter.
2361+ self assert: parameter parentBehaviouralEntity equals: function.
2362+ self deny: parameter hasDefaultValue.
2363+ self deny: parameter isListSplat.
2364+ self deny: parameter isDictionarySplat.
2365+
2366+ self flag: #todo. " Add assertions on type because we currently only have assertions on the existance of the parameter."
23512367]
23522368
23532369{ #category : 'tests - functions' }
@@ -3205,6 +3221,21 @@ FamixPythonProject1Test >> testInvocationToUnknowEntityOfSameNameAsUnknowPackage
32053221 self assert: unknowFunction isStub
32063222]
32073223
3224+ { #category : 'tests' }
3225+ FamixPythonProject1Test >> testInvocationToUnknowEntityOfSameNameAsUnknowPackage2 [
3226+ " Regression test"
3227+
3228+ | unknowFunction |
3229+ " 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."
3230+ unknowFunction := self model entities detect: [ :entity |
3231+ entity class = FamixPythonUnknownEntity and: [ entity name = 'variable_scope' and: [ entity childEntities isEmpty ] ] ].
3232+
3233+ self assert: unknowFunction name equals: 'variable_scope'.
3234+ self assert: unknowFunction parentPackage name equals: 'variable_scope'.
3235+ self deny: unknowFunction identicalTo: unknowFunction parentPackage.
3236+ self assert: unknowFunction isStub
3237+ ]
3238+
32083239{ #category : 'tests - invocations' }
32093240FamixPythonProject1Test >> testInvocationsThatCannotBeResolved [
32103241 " 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."
0 commit comments