Skip to content

Commit

Permalink
Add missing test to read access to parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
jecisc committed Dec 5, 2024
1 parent fccf154 commit c1e9e4b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/Famix-Python-Importer-Tests/FamixPythonProject1Test.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2161,6 +2161,26 @@ FamixPythonProject1Test >> testReadAccessToLocaleInMethod [
self assert: (method accesses anySatisfy: [ :anAccess | anAccess variable = locale ])
]

{ #category : 'tests - accesses' }
FamixPythonProject1Test >> testReadAccessToParameter [

| parameter function access |
parameter := self parameterNamed: 'list1'.
function := self functionNamed: 'sort_list'.

"We want to have the reading and not the writing."
access := (parameter incomingAccesses select: [ :anAccess | anAccess accessor = function ]) detectMax: [ :entity | entity sourceAnchor startPos ].

self assert: access class equals: FamixPythonAccess.
self assert: access source equals: function.
self assert: access accessor equals: function.
self assert: access target equals: parameter.
self assert: access variable equals: parameter.
self deny: access isWrite.
self assert: access isRead.
self assert: (function accesses anySatisfy: [ :anAccess | anAccess variable = parameter ])
]

{ #category : 'tests - modules' }
FamixPythonProject1Test >> testRootModule [

Expand Down

0 comments on commit c1e9e4b

Please sign in to comment.