Merge pull request #24985 from yuwata/codeql
test: several cleanups suggested by CodeQL
This commit is contained in:
@@ -8,8 +8,6 @@
|
||||
|
||||
import re
|
||||
import sys
|
||||
import os
|
||||
from glob import glob
|
||||
|
||||
rules_files = sys.argv[1:]
|
||||
if not rules_files:
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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]:
|
||||
|
||||
Reference in New Issue
Block a user