Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scodoc_issue_976
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
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Louis Dormael
scodoc_issue_976
Commits
b8f5f961
Commit
b8f5f961
authored
1 year ago
by
Emmanuel Viennet
Browse files
Options
Downloads
Patches
Plain Diff
Fix: API edt, tests unit API
parent
676ae47d
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/scodoc/sco_edt_cal.py
+3
-1
3 additions, 1 deletion
app/scodoc/sco_edt_cal.py
tests/api/test_api_permissions.py
+5
-2
5 additions, 2 deletions
tests/api/test_api_permissions.py
with
8 additions
and
3 deletions
app/scodoc/sco_edt_cal.py
+
3
−
1
View file @
b8f5f961
...
@@ -41,7 +41,7 @@ from app.scodoc.sco_exceptions import ScoValueError
...
@@ -41,7 +41,7 @@ from app.scodoc.sco_exceptions import ScoValueError
import
app.scodoc.sco_utils
as
scu
import
app.scodoc.sco_utils
as
scu
def
get_ics_filename
(
edt_id
:
str
)
->
str
:
def
get_ics_filename
(
edt_id
:
str
)
->
str
|
None
:
"
Le chemin vers l
'
ics de cet edt_id
"
"
Le chemin vers l
'
ics de cet edt_id
"
edt_ics_path
=
ScoDocSiteConfig
.
get
(
"
edt_ics_path
"
)
edt_ics_path
=
ScoDocSiteConfig
.
get
(
"
edt_ics_path
"
)
if
not
edt_ics_path
.
strip
():
if
not
edt_ics_path
.
strip
():
...
@@ -62,6 +62,8 @@ def formsemestre_load_calendar(
...
@@ -62,6 +62,8 @@ def formsemestre_load_calendar(
"
accès aux emplois du temps non configuré pour ce semestre (pas d
'
edt_id)
"
"
accès aux emplois du temps non configuré pour ce semestre (pas d
'
edt_id)
"
)
)
ics_filename
=
get_ics_filename
(
edt_id
)
ics_filename
=
get_ics_filename
(
edt_id
)
if
ics_filename
is
None
:
raise
ScoValueError
(
"
accès aux emplois du temps non configuré (pas de chemin)
"
)
try
:
try
:
with
open
(
ics_filename
,
"
rb
"
)
as
file
:
with
open
(
ics_filename
,
"
rb
"
)
as
file
:
log
(
f
"
Loading edt from
{
ics_filename
}
"
)
log
(
f
"
Loading edt from
{
ics_filename
}
"
)
...
...
This diff is collapsed.
Click to expand it.
tests/api/test_api_permissions.py
+
5
−
2
View file @
b8f5f961
...
@@ -70,6 +70,9 @@ def test_permissions(api_headers):
...
@@ -70,6 +70,9 @@ def test_permissions(api_headers):
# par défaut, on passe tous les arguments de all_args
# par défaut, on passe tous les arguments de all_args
endpoint_args
=
{
endpoint_args
=
{
"
api.formsemestres_query
"
:
{},
"
api.formsemestres_query
"
:
{},
"
api.formsemestre_edt
"
:
{
"
formsemestre_id
"
:
1
,
},
}
}
for
rule
in
api_rules
:
for
rule
in
api_rules
:
args
=
endpoint_args
.
get
(
rule
.
endpoint
,
all_args
)
args
=
endpoint_args
.
get
(
rule
.
endpoint
,
all_args
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment