Skip to content

Commit

Permalink
Add tests on classes in different containers
Browse files Browse the repository at this point in the history
  • Loading branch information
jecisc committed Nov 12, 2024
1 parent c21499d commit fb8418b
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions src/Famix-Python-Importer-Tests/FamixPythonProject1Test.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,50 @@ FamixPythonProject1Test >> testClassImportsModule [
self assert: import sourceText equals: 'import moduleAtRoot3'
]

{ #category : 'tests - classes' }
FamixPythonProject1Test >> testClassInClass [

| class |
class := self classNamed: 'ClassInClass'.

self assert: class class equals: FamixPythonClass.
self assert: class name equals: 'ClassInClass'.
self assert: class typeContainer equals: (self classNamed: 'ClassWithClasses')
]

{ #category : 'tests - classes' }
FamixPythonProject1Test >> testClassInFunction [

| class |
class := self classNamed: 'ClassInFunction'.

self assert: class class equals: FamixPythonClass.
self assert: class name equals: 'ClassInFunction'.
self assert: class typeContainer equals: (self functionNamed: 'function_with_class_inside')
]

{ #category : 'tests - classes' }
FamixPythonProject1Test >> testClassInMethod [

| class |
class := self classNamed: 'ClassInMethod'.

self assert: class class equals: FamixPythonClass.
self assert: class name equals: 'ClassInMethod'.
self assert: class typeContainer equals: ((self classNamed: 'ClassWithClasses') methods detect: #isConstructor)
]

{ #category : 'tests - classes' }
FamixPythonProject1Test >> testClassInModule [

| class |
class := self classNamed: 'ClassWithClasses'.

self assert: class class equals: FamixPythonClass.
self assert: class name equals: 'ClassWithClasses'.
self assert: class typeContainer equals: (self moduleNamed: 'moduleWithClasses')
]

{ #category : 'tests - classes' }
FamixPythonProject1Test >> testClassInPackage [

Expand Down

0 comments on commit fb8418b

Please sign in to comment.