aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@google.com>2020-08-15 16:05:26 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-08-15 16:05:26 +0000
commit4e726de5b66ba3d23cf4e51c244ced972236e380 (patch)
treec1b71ad9b3a2ee71e33f081d98fb7b74b1d44105
parent17310693309dbf74f87fab1a5ecd64bbd6aaeac0 (diff)
parent8ee0f2a82668b9b0f58792b54eec36433d10076b (diff)
downloadrepohooks-4e726de5b66ba3d23cf4e51c244ced972236e380.tar.gz
hooks: use dedicated None asserts am: 8ee0f2a826
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1401348 Change-Id: I5f8d55c2c1cdcca60971fa8d6acc5164b2c10fdb
-rwxr-xr-xrh/hooks_unittest.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/rh/hooks_unittest.py b/rh/hooks_unittest.py
index 373e09f..be3a4b3 100755
--- a/rh/hooks_unittest.py
+++ b/rh/hooks_unittest.py
@@ -293,7 +293,7 @@ class BuiltinHooksTests(unittest.TestCase):
"""
# First call should do nothing as there are no files to check.
ret = func(self.project, 'commit', 'desc', (), options=self.options)
- self.assertEqual(ret, None)
+ self.assertIsNone(ret)
self.assertFalse(mock_check.called)
# Second call should include some checks.
@@ -690,21 +690,21 @@ class BuiltinHooksTests(unittest.TestCase):
# First call should do nothing as there are no files to check.
ret = rh.hooks.check_gofmt(
self.project, 'commit', 'desc', (), options=self.options)
- self.assertEqual(ret, None)
+ self.assertIsNone(ret)
self.assertFalse(mock_check.called)
# Second call will have some results.
diff = [rh.git.RawDiffEntry(file='foo.go')]
ret = rh.hooks.check_gofmt(
self.project, 'commit', 'desc', diff, options=self.options)
- self.assertNotEqual(ret, None)
+ self.assertIsNotNone(ret)
def test_jsonlint(self, mock_check, _mock_run):
"""Verify the jsonlint builtin hook."""
# First call should do nothing as there are no files to check.
ret = rh.hooks.check_json(
self.project, 'commit', 'desc', (), options=self.options)
- self.assertEqual(ret, None)
+ self.assertIsNone(ret)
self.assertFalse(mock_check.called)
# TODO: Actually pass some valid/invalid json data down.