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

Unified Diff: tests/presubmit_unittest.py

Issue 924863002: Remove the Singleton<T> presubmit check from presubmit_canned_checks.py (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Add a deprecation warning Created 5 years, 10 months 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 | « presubmit_canned_checks.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/presubmit_unittest.py
diff --git a/tests/presubmit_unittest.py b/tests/presubmit_unittest.py
index e46457e0acb1f0f63278f423a1d6f1e7eaef98ab..4be5daffeb0653989cc74564c29688d94bf8dcf8 100755
--- a/tests/presubmit_unittest.py
+++ b/tests/presubmit_unittest.py
@@ -2087,41 +2087,6 @@ class CannedChecksUnittest(PresubmitTestsBase):
'Foo', None, 'Foo ', None,
presubmit.OutputApi.PresubmitPromptWarning)
- def testCheckSingletonInHeaders(self):
- change1 = presubmit.Change(
- 'foo1', 'foo1\n', self.fake_root_dir, None, 0, 0, None)
- input_api1 = self.MockInputApi(change1, False)
- affected_file1 = self.mox.CreateMock(presubmit.SvnAffectedFile)
- affected_file2 = self.mox.CreateMock(presubmit.SvnAffectedFile)
- input_api1.AffectedSourceFiles(None).AndReturn(
- [affected_file1, affected_file2])
- affected_file1.LocalPath().AndReturn('foo.h')
- input_api1.ReadFile(affected_file1).AndReturn(
- '// Comment mentioning Singleton<Foo>.\n' +
- 'friend class Singleton<Foo>;')
- for _ in range(4):
- affected_file2.LocalPath().AndReturn('foo.cc')
-
- change2 = presubmit.Change(
- 'foo2', 'foo2\n', self.fake_root_dir, None, 0, 0, None)
- input_api2 = self.MockInputApi(change2, False)
-
- affected_file3 = self.mox.CreateMock(presubmit.SvnAffectedFile)
- input_api2.AffectedSourceFiles(None).AndReturn([affected_file3])
- affected_file3.LocalPath().AndReturn('foo.h')
- input_api2.ReadFile(affected_file3).AndReturn(
- 'Foo* foo = Singleton<Foo>::get();')
-
- self.mox.ReplayAll()
-
- results1 = presubmit_canned_checks.CheckSingletonInHeaders(
- input_api1, presubmit.OutputApi)
- self.assertEquals(results1, [])
- results2 = presubmit_canned_checks.CheckSingletonInHeaders(
- input_api2, presubmit.OutputApi)
- self.assertEquals(len(results2), 1)
- self.assertEquals(results2[0].__class__, presubmit.OutputApi.PresubmitError)
-
def testCheckChangeHasOnlyOneEol(self):
self.ReadFileTest(presubmit_canned_checks.CheckChangeHasOnlyOneEol,
"Hey!\nHo!\n", "Hey!\nHo!\n\n",
@@ -2889,9 +2854,6 @@ class CannedChecksUnittest(PresubmitTestsBase):
affected_file.LocalPath().AndReturn('hello.py')
input_api.AffectedSourceFiles(mox.IgnoreArg()).AndReturn([affected_file])
input_api.ReadFile(affected_file).AndReturn('Hey!\nHo!\nHey!\nHo!\n\n')
- input_api.AffectedSourceFiles(mox.IgnoreArg()).AndReturn([affected_file])
- for _ in range(4):
- affected_file.LocalPath().AndReturn('hello.py')
self.mox.ReplayAll()
results = presubmit_canned_checks.PanProjectChecks(
« no previous file with comments | « presubmit_canned_checks.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698