Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Macao Legacy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MACAO
Macao Legacy
Merge requests
!1
Main
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Closed
Main
main
into
26-html2markdown
Overview
0
Commits
39
Pipelines
0
Changes
1
Closed
Main
David Rouquet
requested to merge
main
into
26-html2markdown
9 months ago
Overview
0
Commits
39
Pipelines
0
Changes
1
0
0
Merge request reports
Viewing commit
fb6fad53
Prev
Next
Show latest version
1 file
+
65
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
fb6fad53
Count other types of entities
· fb6fad53
Eliott Sammier
authored
Aug 5, 2024
tetras_extraction/script/src/test.py
+
65
−
0
View file @ fb6fad53
Edit in single-file editor
Open in Web IDE
Show full file
@@ -51,10 +51,75 @@ class TestObjectCount(unittest.TestCase):
?subj :id ?id .
?subj :index ?index .
?subj :titre ?titre .
?subj :description ?desc .
}
"""
,
(
132
,
86
,
132
+
86
),
)
# Types d'activités:
# Cours
self
.
assertCount
(
"""
SELECT * WHERE {
?subj a :Cours .
?subj :description ?desc .
}
"""
,
(
59
,
26
,
59
+
26
),
)
# QCU
self
.
assertCount
(
"""
SELECT DISTINCT ?subj ?desc WHERE {
?subj a :ExerciceQC_QCU .
?subj :aReponse ?rep .
}
"""
,
(
39
,
25
,
39
+
25
),
)
# QCM
self
.
assertCount
(
"""
SELECT DISTINCT ?subj ?desc WHERE {
?subj a :ExerciceQC_QCM .
?subj :aReponse ?rep .
}
"""
,
(
9
,
6
,
9
+
6
),
)
# QM
self
.
assertCount
(
"""
SELECT DISTINCT ?subj ?desc WHERE {
?subj a :ExerciceQM .
}
"""
,
(
8
,
3
,
8
+
3
),
)
# TAT
self
.
assertCount
(
"""
SELECT DISTINCT ?subj ?desc WHERE {
?subj a :ExerciceTAT .
}
"""
,
(
12
,
25
,
12
+
25
),
)
# GD
self
.
assertCount
(
"""
SELECT DISTINCT ?subj ?desc WHERE {
?subj a :ExerciceGD .
}
"""
,
(
5
,
1
,
5
+
1
),
)
# Autres entités
# Réponses
self
.
assertCount
(
"""
SELECT * WHERE {
?subj a :Reponse .
?subj :id ?id .
?subj :index ?index .
?subj :correct ?correct .
?subj :html ?html .
}
"""
,
(
180
,
108
,
180
+
108
),
)
def
assertCount
(
self
,
query
:
str
,
expected_tuple
:
tuple
[
int
|
None
,
int
|
None
,
int
|
None
]
):
Loading