Add test on transaction request chunking

pull/79/head
Michał Sałaban 4 years ago
parent 5a8233c1ac
commit 40102bc21e

@ -1,7 +1,7 @@
coverage~=4.5.1
coveralls
coverage~=5.3
coveralls~=2.1
pip>=9
pytest-cov~=2.5
pytest-runner~=4.2
pytest~=3.6
responses
pytest-cov~=2.10
pytest-runner~=5.2
pytest~=6.1
responses~=0.12

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -132,3 +132,18 @@ class JSONRPCDaemonTestCase(JSONTestCase):
blob=open(path, "rb").read())
rsp = self.daemon.send_transaction(tx)
self.assertEqual(rsp["status"], "OK")
@responses.activate
def test_chunking(self):
responses.add(responses.POST, self.jsonrpc_url,
json=self._read('test_chunking-10-block-693324.json'),
status=200)
responses.add(responses.POST, self.transactions_url,
json=self._read('test_chunking-20-get_transactions_1of2.json'),
status=200)
responses.add(responses.POST, self.transactions_url,
json=self._read('test_chunking-20-get_transactions_2of2.json'),
status=200)
blk = self.daemon.block(height=693324)
self.assertEqual(len(blk.transactions), 105)
self.assertEqual(len(set(blk.transactions)), 105)

Loading…
Cancel
Save