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): ...@@ -148,7 +148,7 @@ class ERP5TestSuite(SlaprunnerTestSuite):
else: else:
result = opener_director.open(url) result = opener_director.open(url)
if result.getcode() is not 200: if result.getcode() != 200:
raise NotHttpOkException(result.getcode()) raise NotHttpOkException(result.getcode())
return result.read() return result.read()
......
...@@ -149,7 +149,7 @@ class KVMTestSuite(ResiliencyTestSuite): ...@@ -149,7 +149,7 @@ class KVMTestSuite(ResiliencyTestSuite):
failure = False failure = False
try: try:
connection = urlopen('http://%s:10080/set?key=%s' % (self.ip, self.key)) connection = urlopen('http://%s:10080/set?key=%s' % (self.ip, self.key))
if connection.getcode() is 200: if connection.getcode() == 200:
break break
else: else:
failure = True failure = True
...@@ -159,7 +159,7 @@ class KVMTestSuite(ResiliencyTestSuite): ...@@ -159,7 +159,7 @@ class KVMTestSuite(ResiliencyTestSuite):
if failure: if failure:
logger.info('Impossible to connect to virtual machine to set key. sleeping...') logger.info('Impossible to connect to virtual machine to set key. sleeping...')
time.sleep(60) 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.') raise Exception('Bad return code when setting key in main instance, after trying for 60 minutes.')
logger.info('Key uploaded to KVM main instance.') logger.info('Key uploaded to KVM main instance.')
......
...@@ -93,7 +93,7 @@ class SlaprunnerTestSuite(ResiliencyTestSuite): ...@@ -93,7 +93,7 @@ class SlaprunnerTestSuite(ResiliencyTestSuite):
else: else:
result = self._opener_director.open(url) result = self._opener_director.open(url)
if result.getcode() is not 200: if result.getcode() != 200:
raise NotHttpOkException(result.getcode()) raise NotHttpOkException(result.getcode())
return result.read() return result.read()
except HTTPError: 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