Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(426)

Unified Diff: tests/gclient_scm_test.py

Issue 5695007: Enhance RunPylint to use white_list and black_list arguments. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: address review comment Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/gcl_unittest.py ('k') | tests/gclient_smoketest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/gclient_scm_test.py
diff --git a/tests/gclient_scm_test.py b/tests/gclient_scm_test.py
index f49b2d82b2e9a561dd5285f261d2434620f700e5..f86bdcba6227be81e39074f195e0af691a77a8d7 100755
--- a/tests/gclient_scm_test.py
+++ b/tests/gclient_scm_test.py
@@ -5,10 +5,11 @@
"""Unit tests for gclient_scm.py."""
+# pylint: disable=E1101,E1103,W0403
+
# Import before super_mox to keep valid references.
from os import rename
from shutil import rmtree
-import StringIO
from subprocess import Popen, PIPE, STDOUT
import tempfile
import unittest
@@ -62,7 +63,7 @@ class BaseTestCase(GCBaseTestCase, SuperMoxTestBase):
class SVNWrapperTestCase(BaseTestCase):
class OptionsObject(object):
- def __init__(self, verbose=False, revision=None):
+ def __init__(self, verbose=False, revision=None):
self.verbose = verbose
self.revision = revision
self.manually_grab_svn_rev = True
@@ -208,7 +209,6 @@ class SVNWrapperTestCase(BaseTestCase):
gclient_scm.os.path.islink(file_path).AndReturn(False)
gclient_scm.os.path.isdir(file_path).AndReturn(True)
gclient_scm.gclient_utils.RemoveDirectory(file_path)
- file_list1 = []
gclient_scm.scm.SVN.RunAndGetFileList(options.verbose,
['update', '--revision', 'BASE'],
cwd=self.base_path,
@@ -340,10 +340,6 @@ class SVNWrapperTestCase(BaseTestCase):
def testUpdateSingleCheckoutSVN14(self):
options = self.Options(verbose=True)
- file_info = {
- 'URL': self.url,
- 'Revision': 42,
- }
# Checks to make sure that we support svn co --depth.
gclient_scm.scm.SVN.current_version = None
@@ -466,7 +462,7 @@ class GitWrapperTestCase(GCBaseTestCase, StdoutCheck, TestCaseUtils,
unittest.TestCase):
"""This class doesn't use pymox."""
class OptionsObject(object):
- def __init__(self, verbose=False, revision=None):
+ def __init__(self, verbose=False, revision=None):
self.verbose = verbose
self.revision = revision
self.manually_grab_svn_rev = True
@@ -523,7 +519,8 @@ from :3
def Options(self, *args, **kwargs):
return self.OptionsObject(*args, **kwargs)
- def CreateGitRepo(self, git_import, path):
+ @staticmethod
+ def CreateGitRepo(git_import, path):
"""Do it for real."""
try:
Popen(['git', 'init', '-q'], stdout=PIPE, stderr=STDOUT,
@@ -694,9 +691,9 @@ from :3
options = self.Options()
expected_file_list = []
for f in ['a', 'b']:
- file_path = join(self.base_path, f)
- open(file_path, 'a').writelines('touched\n')
- expected_file_list.extend([file_path])
+ file_path = join(self.base_path, f)
+ open(file_path, 'a').writelines('touched\n')
+ expected_file_list.extend([file_path])
scm = gclient_scm.CreateSCM(url=self.url, root_dir=self.root_dir,
relpath=self.relpath)
file_list = []
@@ -758,7 +755,7 @@ from :3
scm = gclient_scm.CreateSCM(url=self.url, root_dir=self.root_dir,
relpath=self.relpath)
file_path = join(self.base_path, 'b')
- f = open(file_path, 'w').writelines('conflict\n')
+ open(file_path, 'w').writelines('conflict\n')
exception = (
"error: Your local changes to 'b' would be overwritten by merge. "
"Aborting.\n"
@@ -773,7 +770,8 @@ from :3
scm = gclient_scm.CreateSCM(url=self.url, root_dir=self.root_dir,
relpath=self.relpath)
file_path = join(self.base_path, 'b')
- f = open(file_path, 'w').writelines('conflict\n')
+ open(file_path, 'w').writelines('conflict\n')
+ # pylint: disable=W0212
scm._Run(['commit', '-am', 'test'], options)
__builtin__.raw_input = lambda x: 'y'
exception = ('Conflict while rebasing this branch.\n'
« no previous file with comments | « tests/gcl_unittest.py ('k') | tests/gclient_smoketest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698