Unverified Commit 96d2ec16 authored by Peter Stanko's avatar Peter Stanko
Browse files

Added tests for test submission files

parent 4b1d00b9
Pipeline #13454 passed with stage
in 42 minutes and 15 seconds
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()
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')
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment