|
| 1 | +from rsptx.db.crud import * |
| 2 | +import pytest |
| 3 | + |
| 4 | +async def test_create_useinfo_entry(): |
| 5 | + assert create_useinfo_entry is not None |
| 6 | + # Write the code for the test here. |
| 7 | + # Tip: use the pytest.raises context manager to test for exceptions. |
| 8 | + # create and new entry |
| 9 | + with pytest.raises(Exception): |
| 10 | + create_useinfo_entry( |
| 11 | + sid="test_sid", |
| 12 | + div_id="test_div_id", |
| 13 | + event="test_event", |
| 14 | + act="test_act", |
| 15 | + timestamp="test_timestamp", |
| 16 | + course_id="test_course_id", |
| 17 | + chapter="test_chapter", |
| 18 | + subchapter="test_subchapter", |
| 19 | + session="test_session", |
| 20 | + ip_address="test_ip_address", |
| 21 | + ) |
| 22 | + x = await create_useinfo_entry( |
| 23 | + sid="test_sid", |
| 24 | + div_id="test_div_id", |
| 25 | + event="test_event", |
| 26 | + act="test_act", |
| 27 | + timestamp="test_timestamp", |
| 28 | + course_id="test_course_id", |
| 29 | + chapter="test_chapter", |
| 30 | + subchapter="test_subchapter", |
| 31 | + session="test_session", |
| 32 | + ip_address="test_ip_address", |
| 33 | + ) |
| 34 | + assert x is not None |
| 35 | + assert x.sid == "test_sid" |
| 36 | + assert x.div_id == "test_div_id" |
| 37 | + assert x.event == "test_event" |
| 38 | + assert x.act == "test_act" |
| 39 | + assert x.timestamp == "test_timestamp" |
| 40 | + assert x.course_id == "test_course_id" |
| 41 | + assert x.chapter == "test_chapter" |
| 42 | + assert x.subchapter == "test_subchapter" |
| 43 | + assert x.session == "test_session" |
| 44 | + assert x.ip_address == "test_ip_address" |
| 45 | + |
| 46 | + |
| 47 | + |
0 commit comments