From 3ef0653711d032cc780d3b64c06f703b9272f4ea Mon Sep 17 00:00:00 2001 From: Ben Patterson Date: Sat, 11 Oct 2014 12:51:20 -0400 Subject: [PATCH] pylint cleanup. --- .../contentstore/views/tests/test_course_updates.py | 4 ++-- .../contentstore/views/tests/test_import_export.py | 5 +++-- common/djangoapps/student/tests/test_email.py | 1 - common/djangoapps/student/tests/test_enrollment.py | 2 -- common/djangoapps/student/tests/test_recent_enrollments.py | 1 - common/djangoapps/terrain/stubs/tests/test_xqueue_stub.py | 2 -- common/djangoapps/track/tests/test_middleware.py | 2 -- 7 files changed, 5 insertions(+), 12 deletions(-) diff --git a/cms/djangoapps/contentstore/views/tests/test_course_updates.py b/cms/djangoapps/contentstore/views/tests/test_course_updates.py index 8a0fa8fe36..0875bdbb61 100644 --- a/cms/djangoapps/contentstore/views/tests/test_course_updates.py +++ b/cms/djangoapps/contentstore/views/tests/test_course_updates.py @@ -18,9 +18,9 @@ class CourseUpdateTest(CourseTestCase): kwargs = {'provided_id': str(provided_id)} if provided_id else None return reverse_course_url('course_info_update_handler', course_key, kwargs=kwargs) - '''The do all and end all of unit test cases.''' + # The do all and end all of unit test cases. def test_course_update(self): - '''Go through each interface and ensure it works.''' + """Go through each interface and ensure it works.""" def get_response(content, date): """ Helper method for making call to server and returning response. diff --git a/cms/djangoapps/contentstore/views/tests/test_import_export.py b/cms/djangoapps/contentstore/views/tests/test_import_export.py index 741dd27ecf..8f42d8eaa6 100644 --- a/cms/djangoapps/contentstore/views/tests/test_import_export.py +++ b/cms/djangoapps/contentstore/views/tests/test_import_export.py @@ -217,6 +217,7 @@ class ImportTestCase(CourseTestCase): """ def try_tar(tarpath): + """ Attempt to tar an unacceptable file """ with open(tarpath) as tar: args = {"name": tarpath, "course-data": [tar]} resp = self.client.post(self.url, args) @@ -307,10 +308,10 @@ class ExportTestCase(CourseTestCase): self._verify_export_failure(u'/container/{}'.format(vertical.location)) - def _verify_export_failure(self, expectedText): + def _verify_export_failure(self, expected_text): """ Export failure helper method. """ resp = self.client.get(self.url, HTTP_ACCEPT='application/x-tgz') self.assertEquals(resp.status_code, 200) self.assertIsNone(resp.get('Content-Disposition')) self.assertContains(resp, 'Unable to create xml for module') - self.assertContains(resp, expectedText) + self.assertContains(resp, expected_text) diff --git a/common/djangoapps/student/tests/test_email.py b/common/djangoapps/student/tests/test_email.py index 14d0122fee..3112e4c24c 100644 --- a/common/djangoapps/student/tests/test_email.py +++ b/common/djangoapps/student/tests/test_email.py @@ -15,7 +15,6 @@ from django.conf import settings from edxmako.shortcuts import render_to_string from edxmako.tests import mako_middleware_process_request from util.request import safe_get_host -from textwrap import dedent class TestException(Exception): diff --git a/common/djangoapps/student/tests/test_enrollment.py b/common/djangoapps/student/tests/test_enrollment.py index 6defca14f0..58a32dd312 100644 --- a/common/djangoapps/student/tests/test_enrollment.py +++ b/common/djangoapps/student/tests/test_enrollment.py @@ -1,8 +1,6 @@ """ Tests for student enrollment. """ -from datetime import datetime, timedelta -import pytz import ddt import unittest diff --git a/common/djangoapps/student/tests/test_recent_enrollments.py b/common/djangoapps/student/tests/test_recent_enrollments.py index 7d1687bf03..34ec6e38b9 100644 --- a/common/djangoapps/student/tests/test_recent_enrollments.py +++ b/common/djangoapps/student/tests/test_recent_enrollments.py @@ -4,7 +4,6 @@ Tests for the recently enrolled messaging within the Dashboard. import datetime from django.conf import settings from django.core.urlresolvers import reverse -from django.test import Client from opaque_keys.edx import locator from pytz import UTC import unittest diff --git a/common/djangoapps/terrain/stubs/tests/test_xqueue_stub.py b/common/djangoapps/terrain/stubs/tests/test_xqueue_stub.py index 1aca28857e..4b17018029 100644 --- a/common/djangoapps/terrain/stubs/tests/test_xqueue_stub.py +++ b/common/djangoapps/terrain/stubs/tests/test_xqueue_stub.py @@ -6,8 +6,6 @@ import mock import unittest import json import requests -import time -import copy from ..xqueue import StubXQueueService, StubXQueueHandler diff --git a/common/djangoapps/track/tests/test_middleware.py b/common/djangoapps/track/tests/test_middleware.py index 5779890d3a..40513cf8f7 100644 --- a/common/djangoapps/track/tests/test_middleware.py +++ b/common/djangoapps/track/tests/test_middleware.py @@ -1,5 +1,3 @@ -import re - from mock import patch from mock import sentinel