Skip to content
This repository was archived by the owner on Dec 26, 2022. It is now read-only.

Commit af7d054

Browse files
committed
fix(reg): Remove useless error return and logging
Use list pass_case to recode which cases are passing cases.
1 parent b65e818 commit af7d054

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

tests/regression/runner.py

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,6 @@ def test_mam_send_msg(self):
142142
response[i][0] + ", status code = " + response[i][1])
143143

144144
for i in range(len(response)):
145-
logging.debug("send msg i = " + str(i) + ", res = " +
146-
response[i][0] + ", status code = " + response[i][1])
147145
if i in pass_case:
148146
res_json = json.loads(response[i][0])
149147
self.assertTrue(valid_trytes(res_json["channel"], LEN_ADDR))
@@ -188,8 +186,6 @@ def test_mam_recv_msg(self):
188186

189187
pass_case = [0]
190188
for i in range(len(test_cases)):
191-
logging.debug("recv msg i = " + str(i) + ", res = " +
192-
response[i][0] + ", status code = " + response[i][1])
193189
if i in pass_case:
194190
self.assertTrue(expect_cases[i] in response[i][0])
195191
else:
@@ -263,8 +259,6 @@ def test_send_transfer(self):
263259

264260
pass_case = [0, 1, 2, 3]
265261
for i in range(len(response)):
266-
logging.debug("send transfer i = " + str(i) + ", res = " +
267-
response[i][0] + ", status code = " + response[i][1])
268262
if i in pass_case:
269263
res_json = json.loads(response[i][0])
270264

@@ -353,11 +347,9 @@ def test_find_transactions_by_tag(self):
353347
logging.debug("find transactions by tag i = " + str(i) +
354348
", res = " + response[i][0] + ", status code = " +
355349
response[i][1])
350+
pass_case = [0, 1]
356351
for i in range(len(response)):
357-
logging.debug("find transactions by tag i = " + str(i) +
358-
", res = " + response[i][0] + ", status code = " +
359-
response[i][1])
360-
if i == 0 or i == 1:
352+
if i in pass_case:
361353
tx_res_json = json.loads(transaction_response[i][0])
362354
res_json = json.loads(response[i][0])
363355

@@ -417,11 +409,9 @@ def test_get_transactions_object(self):
417409
", res = " + repr(response[i][0]) +
418410
", status code = " + repr(response[i][1]))
419411

412+
pass_case = [0]
420413
for i in range(len(response)):
421-
logging.debug("get transactions object i = " + str(i) +
422-
", res = " + repr(response[i][0]) +
423-
", status code = " + repr(response[i][1]))
424-
if i == 0:
414+
if i in pass_case:
425415
res_json = json.loads(response[i][0])
426416
self.assertEqual(sent_transaction_hash, res_json["hash"])
427417
else:
@@ -461,6 +451,3 @@ def test_get_transactions_object(self):
461451
else:
462452
logging.basicConfig(level=logging.INFO)
463453
unittest.main(argv=['first-arg-is-ignored'], exit=True)
464-
465-
if len(unittest.TestResult().errors) != 0:
466-
exit(1)

0 commit comments

Comments
 (0)