Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Kontr 2.0
Portal API Backend
Commits
47aa4200
Verified
Commit
47aa4200
authored
Oct 09, 2018
by
Peter Stanko
Browse files
Test for update-test-files
parent
ba442e7a
Pipeline
#16351
passed with stage
in 10 minutes and 14 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
portal/service/projects.py
View file @
47aa4200
...
...
@@ -179,8 +179,7 @@ class ProjectService(GeneralService):
return
filters
.
filter_projects_from_course
(
course
=
course
,
user
=
perm_service
.
client
)
raise
ForbiddenError
(
perm_service
.
client
)
def
update_project_test_files
(
self
):
def
update_project_test_files
(
self
):
""" Sends a request to Storage to update the project's test_files to the newest version.
"""
tasks
.
update_project_test_files
.
delay
(
self
.
project
.
course
.
id
,
self
.
project
.
id
)
tests/rest/test_project.py
View file @
47aa4200
...
...
@@ -3,7 +3,6 @@ from datetime import timedelta
import
pytest
from
flask_jwt_extended
import
create_access_token
from
mock
import
patch
from
portal.database.models
import
Course
,
Project
,
User
from
portal.tools.time
import
current_time
,
strip_seconds
...
...
@@ -282,3 +281,12 @@ def test_create_submission_as_with_default_params(client, ent_mocker, rest_servi
assert
submission
.
parameters
[
'file_params'
][
'from_dir'
]
==
project
.
codename
gitlab_url
=
f
'git@gitlab.local/
{
user
.
username
}
/
{
course
.
codename
}
'
assert
submission
.
parameters
[
'file_params'
][
'source'
][
'url'
]
==
gitlab_url
@
pytest
.
mark
.
celery
(
result_backend
=
'redis://'
)
def
test_refresh_test_files
(
client
,
ent_mocker
,
rest_service
):
project
=
rest_service
.
find
.
project
(
'testcourse1'
,
'hw01'
)
path
=
f
'/courses/
{
project
.
course
.
id
}
/projects/
{
project
.
id
}
/test-files-refresh'
response
=
rest_tools
.
make_request
(
client
,
path
,
method
=
'post'
)
assert_response
(
response
,
code
=
204
)
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment