Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-proctoring
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
edx-proctoring
Commits
4437e5e4
Commit
4437e5e4
authored
Jun 30, 2015
by
Muhammad Shoaib
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added the coverage for the api function get_exam_attempt
parent
840e3dbb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
5 deletions
+33
-5
edx_proctoring/tests/test_api.py
+33
-5
No files found.
edx_proctoring/tests/test_api.py
View file @
4437e5e4
...
...
@@ -3,11 +3,29 @@ All tests for the models.py
"""
from
datetime
import
datetime
import
pytz
from
edx_proctoring.api
import
create_exam
,
update_exam
,
get_exam_by_id
,
get_exam_by_content_id
,
\
add_allowance_for_user
,
remove_allowance_for_user
,
start_exam_attempt
,
stop_exam_attempt
,
get_active_exams_for_user
from
edx_proctoring.exceptions
import
ProctoredExamAlreadyExists
,
ProctoredExamNotFoundException
,
\
StudentExamAttemptAlreadyExistsException
,
StudentExamAttemptDoesNotExistsException
from
edx_proctoring.models
import
ProctoredExam
,
ProctoredExamStudentAllowance
,
ProctoredExamStudentAttempt
from
edx_proctoring.api
import
(
create_exam
,
update_exam
,
get_exam_by_id
,
get_exam_by_content_id
,
add_allowance_for_user
,
remove_allowance_for_user
,
start_exam_attempt
,
stop_exam_attempt
,
get_active_exams_for_user
,
get_exam_attempt
)
from
edx_proctoring.exceptions
import
(
ProctoredExamAlreadyExists
,
ProctoredExamNotFoundException
,
StudentExamAttemptAlreadyExistsException
,
StudentExamAttemptDoesNotExistsException
)
from
edx_proctoring.models
import
(
ProctoredExam
,
ProctoredExamStudentAllowance
,
ProctoredExamStudentAttempt
)
from
.utils
import
(
LoggedInTestCase
...
...
@@ -176,6 +194,16 @@ class ProctoredExamApiTests(LoggedInTestCase):
attempt_id
=
start_exam_attempt
(
self
.
proctored_exam_id
,
self
.
user_id
,
self
.
external_id
)
self
.
assertGreater
(
attempt_id
,
0
)
def
test_get_exam_attempt
(
self
):
"""
Test to get the already made exam attempt.
"""
self
.
_create_student_exam_attempt
()
exam_attempt
=
get_exam_attempt
(
self
.
proctored_exam_id
,
self
.
user_id
)
self
.
assertEqual
(
exam_attempt
[
'proctored_exam_id'
],
self
.
proctored_exam_id
)
self
.
assertEqual
(
exam_attempt
[
'user_id'
],
self
.
user_id
)
def
test_restart_exam_attempt
(
self
):
"""
Start an exam attempt that has already been started.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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