Commit dfb32247 authored by Kirill Smelkov's avatar Kirill Smelkov

*: Compare integers by == or != instead of by `is` or `is not`

Same logic as in previous patch. Suggested by @jeorme in
!122 (comment 193062) .

/suggested-and-reviewed-by @jerome
/reviewed-n !122
parent b1c4c044
Pipeline #30826 passed with stage
in 0 seconds
......@@ -148,7 +148,7 @@ class ERP5TestSuite(SlaprunnerTestSuite):
else:
result = opener_director.open(url)
if result.getcode() is not 200:
if result.getcode() != 200:
raise NotHttpOkException(result.getcode())
return result.read()
......
......@@ -149,7 +149,7 @@ class KVMTestSuite(ResiliencyTestSuite):
failure = False
try:
connection = urlopen('http://%s:10080/set?key=%s' % (self.ip, self.key))
if connection.getcode() is 200:
if connection.getcode() == 200:
break
else:
failure = True
......@@ -159,7 +159,7 @@ class KVMTestSuite(ResiliencyTestSuite):
if failure:
logger.info('Impossible to connect to virtual machine to set key. sleeping...')
time.sleep(60)
if i is 59:
if i == 59:
raise Exception('Bad return code when setting key in main instance, after trying for 60 minutes.')
logger.info('Key uploaded to KVM main instance.')
......
......@@ -93,7 +93,7 @@ class SlaprunnerTestSuite(ResiliencyTestSuite):
else:
result = self._opener_director.open(url)
if result.getcode() is not 200:
if result.getcode() != 200:
raise NotHttpOkException(result.getcode())
return result.read()
except HTTPError:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment