From c488ce2adc608ed28167b1f518c6f6070a0cd896 Mon Sep 17 00:00:00 2001 From: "Dave St.Germain" Date: Tue, 11 Dec 2018 15:24:08 -0500 Subject: [PATCH] Addressed review feedback --- Makefile | 4 +--- edx_proctoring/backends/rest.py | 4 ++-- edx_proctoring/backends/software_secure.py | 4 ++-- edx_proctoring/backends/tests/test_rest.py | 4 ++-- edx_proctoring/backends/tests/test_software_secure.py | 4 ++-- edx_proctoring/exceptions.py | 2 +- edx_proctoring/settings/common.py | 10 ++-------- 7 files changed, 12 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index 6f5ce169d95..4afcb6b8569 100644 --- a/Makefile +++ b/Makefile @@ -22,9 +22,7 @@ help: ## display this help message @perl -nle'print $& if m{^[a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m %-25s\033[0m %s\n", $$1, $$2}' clean: ## remove generated byte code, coverage reports, and build artifacts - find . -name '*.pyc' -delete - find . -name '*.pyo' -delete - find . -name '*~' -delete + find . -name '*.pyc' -o -name '*.pyo' -o -name '*~' -delete rm -fr build/ dist/ *.egg-info upgrade: ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in diff --git a/edx_proctoring/backends/rest.py b/edx_proctoring/backends/rest.py index 640f6df285b..87087f36f64 100644 --- a/edx_proctoring/backends/rest.py +++ b/edx_proctoring/backends/rest.py @@ -11,7 +11,7 @@ from webpack_loader.exceptions import BaseWebpackLoaderException, WebpackBundleLookupError from edx_proctoring.backends.backend import ProctoringBackendProvider -from edx_proctoring.exceptions import BackendProvideCannotRegisterAttempt +from edx_proctoring.exceptions import BackendProviderCannotRegisterAttempt from edx_proctoring.statuses import ProctoredExamStudentAttemptStatus from edx_rest_api_client.client import OAuthAPIClient @@ -163,7 +163,7 @@ def register_exam_attempt(self, exam, context): log.debug('Creating exam attempt for %r at %r', exam['external_id'], url) response = self.session.post(url, json=payload) if response.status_code != 200: - raise BackendProvideCannotRegisterAttempt(response.content) + raise BackendProviderCannotRegisterAttempt(response.content) response = response.json() log.debug(response) return response['id'] diff --git a/edx_proctoring/backends/software_secure.py b/edx_proctoring/backends/software_secure.py index 1396cb5cfdf..c06f05f1e32 100644 --- a/edx_proctoring/backends/software_secure.py +++ b/edx_proctoring/backends/software_secure.py @@ -24,7 +24,7 @@ from edx_proctoring.backends.backend import ProctoringBackendProvider from edx_proctoring import constants from edx_proctoring.exceptions import ( - BackendProvideCannotRegisterAttempt, + BackendProviderCannotRegisterAttempt, ProctoredExamSuspiciousLookup, ) from edx_proctoring.statuses import SoftwareSecureReviewStatus @@ -91,7 +91,7 @@ def register_exam_attempt(self, exam, context): ) ) log.error(err_msg) - raise BackendProvideCannotRegisterAttempt(err_msg) + raise BackendProviderCannotRegisterAttempt(err_msg) # get the external ID that Software Secure has defined # for this attempt diff --git a/edx_proctoring/backends/tests/test_rest.py b/edx_proctoring/backends/tests/test_rest.py index eef26b1ef02..f1f3eac843b 100644 --- a/edx_proctoring/backends/tests/test_rest.py +++ b/edx_proctoring/backends/tests/test_rest.py @@ -12,7 +12,7 @@ from django.utils import translation from edx_proctoring.backends.rest import BaseRestProctoringProvider -from edx_proctoring.exceptions import BackendProvideCannotRegisterAttempt +from edx_proctoring.exceptions import BackendProviderCannotRegisterAttempt class RESTBackendTests(TestCase): @@ -193,7 +193,7 @@ def test_register_exam_attempt_failure(self): json={'error': 'something'}, status=400 ) - with self.assertRaises(BackendProvideCannotRegisterAttempt): + with self.assertRaises(BackendProviderCannotRegisterAttempt): self.provider.register_exam_attempt(self.backend_exam, context) @responses.activate diff --git a/edx_proctoring/backends/tests/test_software_secure.py b/edx_proctoring/backends/tests/test_software_secure.py index 8578bf76f27..11df5832915 100644 --- a/edx_proctoring/backends/tests/test_software_secure.py +++ b/edx_proctoring/backends/tests/test_software_secure.py @@ -17,7 +17,7 @@ from edx_proctoring.runtime import set_runtime_service from edx_proctoring.backends import get_backend_provider -from edx_proctoring.exceptions import BackendProvideCannotRegisterAttempt +from edx_proctoring.exceptions import BackendProviderCannotRegisterAttempt from edx_proctoring import constants from edx_proctoring.api import ( @@ -501,7 +501,7 @@ def test_failing_register_attempt(self): # now try a failing request with HTTMock(mock_response_error): - with self.assertRaises(BackendProvideCannotRegisterAttempt): + with self.assertRaises(BackendProviderCannotRegisterAttempt): create_exam_attempt(exam_id, self.user.id, taking_as_proctored=True) def test_payload_construction(self): diff --git a/edx_proctoring/exceptions.py b/edx_proctoring/exceptions.py index ca0c1007b61..85acb123164 100644 --- a/edx_proctoring/exceptions.py +++ b/edx_proctoring/exceptions.py @@ -71,7 +71,7 @@ class AllowanceValueNotAllowedException(ProctoredBaseException): """ -class BackendProvideCannotRegisterAttempt(ProctoredBaseException): +class BackendProviderCannotRegisterAttempt(ProctoredBaseException): """ Raised when a back-end provider cannot register an attempt """ diff --git a/edx_proctoring/settings/common.py b/edx_proctoring/settings/common.py index 6257794692a..b8f3140908c 100644 --- a/edx_proctoring/settings/common.py +++ b/edx_proctoring/settings/common.py @@ -12,22 +12,16 @@ def plugin_settings(settings): [ 'proctoring/js/models/proctored_exam_allowance_model.js', 'proctoring/js/models/proctored_exam_attempt_model.js', - 'proctoring/js/models/proctored_exam_model.js' - ] + - [ + 'proctoring/js/models/proctored_exam_model.js', 'proctoring/js/collections/proctored_exam_allowance_collection.js', 'proctoring/js/collections/proctored_exam_attempt_collection.js', - 'proctoring/js/collections/proctored_exam_collection.js' - ] + - [ + 'proctoring/js/collections/proctored_exam_collection.js', 'proctoring/js/views/Backbone.ModalDialog.js', 'proctoring/js/views/proctored_exam_add_allowance_view.js', 'proctoring/js/views/proctored_exam_allowance_view.js', 'proctoring/js/views/proctored_exam_attempt_view.js', 'proctoring/js/views/proctored_exam_view.js', 'proctoring/js/views/proctored_exam_instructor_launch.js', - ] + - [ 'proctoring/js/proctored_app.js', 'proctoring/js/exam_action_handler.js' ]