diff --git a/openedx/core/lib/django_test_client_utils.py b/openedx/core/lib/django_test_client_utils.py index 47d57dec65..42d67f8fe9 100644 --- a/openedx/core/lib/django_test_client_utils.py +++ b/openedx/core/lib/django_test_client_utils.py @@ -2,6 +2,9 @@ This file includes the monkey-patch for requests' PATCH method, as we are using older version of django that does not contains the PATCH method in its test client. """ + +# pylint: disable=protected-access + from __future__ import unicode_literals from urlparse import urlparse @@ -13,11 +16,13 @@ BOUNDARY = 'BoUnDaRyStRiNg' MULTIPART_CONTENT = 'multipart/form-data; boundary=%s' % BOUNDARY -def request_factory_patch(self, path, data={}, content_type=MULTIPART_CONTENT, **extra): +def request_factory_patch(self, path, data=None, content_type=MULTIPART_CONTENT, **extra): """ Construct a PATCH request. """ - patch_data = self._encode_data(data, content_type) + # pylint: disable=invalid-name + + patch_data = self._encode_data(data or {}, content_type) parsed = urlparse(path) r = { @@ -32,11 +37,11 @@ def request_factory_patch(self, path, data={}, content_type=MULTIPART_CONTENT, * return self.request(**r) -def client_patch(self, path, data={}, content_type=MULTIPART_CONTENT, follow=False, **extra): +def client_patch(self, path, data=None, content_type=MULTIPART_CONTENT, follow=False, **extra): """ Send a resource to the server using PATCH. """ - response = super(Client, self).patch(path, data=data, content_type=content_type, **extra) + response = super(Client, self).patch(path, data=data or {}, content_type=content_type, **extra) if follow: response = self._handle_redirects(response, **extra) return response diff --git a/openedx/core/lib/logsettings.py b/openedx/core/lib/logsettings.py index 05b2d4f0cd..593df6b323 100644 --- a/openedx/core/lib/logsettings.py +++ b/openedx/core/lib/logsettings.py @@ -1,3 +1,5 @@ +"""Get log settings.""" + import os import platform import sys diff --git a/openedx/core/lib/rooted_paths.py b/openedx/core/lib/rooted_paths.py index 3339d6471d..5a72fd70c6 100644 --- a/openedx/core/lib/rooted_paths.py +++ b/openedx/core/lib/rooted_paths.py @@ -1,3 +1,5 @@ +"""Provides rooted_glob, for finding relative glob paths in another director.""" + import glob2 diff --git a/openedx/core/lib/tempdir.py b/openedx/core/lib/tempdir.py index b3f10b22e0..8d440ad14c 100644 --- a/openedx/core/lib/tempdir.py +++ b/openedx/core/lib/tempdir.py @@ -6,7 +6,7 @@ import shutil import tempfile -def mkdtemp_clean(suffix="", prefix="tmp", dir=None): +def mkdtemp_clean(suffix="", prefix="tmp", dir=None): # pylint: disable=redefined-builtin """Just like mkdtemp, but the directory will be deleted when the process ends.""" the_dir = tempfile.mkdtemp(suffix=suffix, prefix=prefix, dir=dir) atexit.register(cleanup_tempdir, the_dir)