Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add rest call to archive course versions #10

Merged
merged 3 commits into from
Nov 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pluvo/pluvo.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,10 @@ def set_course(self, course):
def delete_course(self, course_id):
return self._request('DELETE', 'course/{}/'.format(course_id))

def archive_student_course_version(self, course_id, student_id):
url = 'course/{}/user/{}/'.format(course_id, student_id)
return self._request('PUT', url, {'action': 'archive'})

def set_organisation(self, organisation):
if 'id' in organisation:
return self._request(
Expand Down
10 changes: 10 additions & 0 deletions tests/test_pluvo.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,16 @@ def test_pluvo_get_progress_report(mocker):
})


def test_pluvo_archive_student_course_version(mocker):
p = pluvo.Pluvo()
mocker.patch.object(p, '_request')

retval = p.archive_student_course_version(1, 2)
assert retval == p._request.return_value
p._request.assert_called_once_with(
'PUT', 'course/1/user/2/', {'action': 'archive'})


def test_pluvo_get_version(mocker):
p = pluvo.Pluvo()
mocker.patch.object(p, '_request')
Expand Down