Add required test suite and websocket fixes
This commit is contained in:
@@ -1,2 +1,17 @@
|
||||
def test_placeholder_csv_export():
|
||||
assert True
|
||||
from conftest import create_session, join_student
|
||||
|
||||
|
||||
def test_csv_export_contains_one_row_per_submission(client, sample_pool):
|
||||
sid = create_session(client, sample_pool)
|
||||
join_student(client, sid, "s1", "Student One")
|
||||
rooms = client.app.state.rooms
|
||||
client.portal.call(rooms.open_question, sid, 0, 2)
|
||||
ack = client.portal.call(rooms.submit_answer, sid, "s1", 0, "B")
|
||||
assert ack["type"] == "submit_ack"
|
||||
client.portal.call(rooms.close_question, sid)
|
||||
|
||||
response = client.get(f"/admin/api/sessions/{sid}/csv")
|
||||
lines = response.text.strip().splitlines()
|
||||
assert lines[0] == "sid,student_id,name,question_idx,answer,elapsed_ms,score,status"
|
||||
assert len(lines) == 2
|
||||
assert ",s1,Student One,0,B," in lines[1]
|
||||
|
||||
Reference in New Issue
Block a user