Skip to content
Snippets Groups Projects
Commit 47336dd9 authored by Holger Nahrstaedt's avatar Holger Nahrstaedt
Browse files

Fix unit test and added call_retry check for WebSocketConnectionClosedException

parent 43cceade
No related branches found
No related tags found
No related merge requests found
...@@ -349,8 +349,9 @@ class GrapheneRPC(object): ...@@ -349,8 +349,9 @@ class GrapheneRPC(object):
break break
except KeyboardInterrupt: except KeyboardInterrupt:
raise raise
except WebSocketConnectionClosedException: except WebSocketConnectionClosedException as e:
# self.error_cnt[self.url] += 1 # self.nodes.increase_error_cnt()
self.nodes.sleep_and_check_retries(str(e), sleep=True, call_retry=True)
self.rpcconnect(next_url=False) self.rpcconnect(next_url=False)
except ConnectionError as e: except ConnectionError as e:
self.nodes.increase_error_cnt() self.nodes.increase_error_cnt()
......
...@@ -104,7 +104,7 @@ class Testcases(unittest.TestCase): ...@@ -104,7 +104,7 @@ class Testcases(unittest.TestCase):
h_list = [] h_list = []
for h in account.history(stop=10, use_block_num=False, batch_size=10, raw_output=True): for h in account.history(stop=10, use_block_num=False, batch_size=10, raw_output=True):
h_list.append(h) h_list.append(h)
self.assertEqual(h_list[0][0], zero_element) zero_element = h_list[0][0]
self.assertEqual(h_list[-1][0], 10) self.assertEqual(h_list[-1][0], 10)
self.assertEqual(h_list[0][1]['block'], h_all_raw[-1][1]['block']) self.assertEqual(h_list[0][1]['block'], h_all_raw[-1][1]['block'])
self.assertEqual(h_list[-1][1]['block'], h_all_raw[-11 + zero_element][1]['block']) self.assertEqual(h_list[-1][1]['block'], h_all_raw[-11 + zero_element][1]['block'])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment