Skip to content
Snippets Groups Projects
Commit fb6fad53 authored by Eliott Sammier's avatar Eliott Sammier
Browse files

Count other types of entities

parent b36ee6a6
Branches
No related tags found
1 merge request!1Main
...@@ -51,10 +51,75 @@ class TestObjectCount(unittest.TestCase): ...@@ -51,10 +51,75 @@ class TestObjectCount(unittest.TestCase):
?subj :id ?id . ?subj :id ?id .
?subj :index ?index . ?subj :index ?index .
?subj :titre ?titre . ?subj :titre ?titre .
?subj :description ?desc .
}""", }""",
(132, 86, 132 + 86), (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( def assertCount(
self, query: str, expected_tuple: tuple[int | None, int | None, int | None] self, query: str, expected_tuple: tuple[int | None, int | None, int | None]
): ):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment