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
96d2ec16
Unverified
Commit
96d2ec16
authored
Sep 24, 2018
by
Peter Stanko
Browse files
Added tests for test submission files
parent
4b1d00b9
Pipeline
#13454
passed with stage
in 42 minutes and 15 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
tests/rest/test_submission_files.py
View file @
96d2ec16
import
pytest
from
portal.database
import
ProjectConfig
from
tests.utils.ent_mocker
import
EntitiesMocker
from
.
import
utils
...
...
@@ -9,6 +10,8 @@ def mocked_submission(ent_mocker: EntitiesMocker, rest_service):
submission
=
ent_mocker
.
create_submission
()
rest_service
.
submissions
.
write_entity
(
submission
)
ent_mocker
.
create_submission_storage
(
submission
=
submission
)
project_config
:
ProjectConfig
=
submission
.
project
.
config
project_config
.
test_files_commit_hash
=
'some-random-hash'
return
submission
...
...
@@ -31,3 +34,10 @@ def test_submission_results_are_available(client, mocked_submission):
assert
response
.
data
assert
response
.
data
.
decode
(
'utf-8'
)
==
expected
(
'student.json'
)
def
test_submission_test_files_are_available
(
client
,
mocked_submission
):
s
=
mocked_submission
response
=
utils
.
make_request
(
client
,
f
'/submissions/
{
s
.
id
}
/files/test_files?path=test_main.c'
)
assert
response
.
status_code
==
200
assert
response
.
data
assert
response
.
data
.
decode
(
'utf-8'
)
==
expected
(
'test_main.c'
)
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