Merge pull request #24985 from yuwata/codeql

test: several cleanups suggested by CodeQL
This commit is contained in:
Yu Watanabe
2022-10-13 21:36:16 +09:00
committed by GitHub
3 changed files with 7 additions and 3 deletions
-2
View File
@@ -8,8 +8,6 @@
import re
import sys
import os
from glob import glob
rules_files = sys.argv[1:]
if not rules_files:
+6
View File
@@ -100,6 +100,12 @@ class SD(object):
def __cmp__(self, other):
return cmp(self._num, other._num)
def __eq__(self, other):
return self.__cmp__(other) == 0
def __ne__(self, other):
return not self.__eq__(other)
def __hash__(self):
return hash(self._num)
+1 -1
View File
@@ -200,7 +200,7 @@ class ExecutionResumeTest(unittest.TestCase):
self.reload()
time.sleep(5)
self.assertTrue(subprocess.call("journalctl -b _PID=1 | grep -q 'Freezing execution'", shell=True) != 0)
self.assertNotEqual(subprocess.call("journalctl -b _PID=1 | grep -q 'Freezing execution'", shell=True), 0)
def tearDown(self):
for f in [self.output_file, self.unitfile_path]: