def test_push_unconfirmed_transaction_thenPushesTransactionAndReturnsNone(self):
transaction_one = {
'from': 'from',
'timestamp': 1498923800,
'to': 'to',
'amount': 1,
'signature': 'signature_one',
'hash': "transaction_hash_one"
}
with patch.object(Blockchain, '__init__', return_value=None) as patched_init:
subject = Blockchain()
subject.unconfirmed_transactions = Queue()
resp = subject.push_unconfirmed_transaction(transaction_one)
self.assertTrue(resp)
self.assertEqual(subject.unconfirmed_transactions.qsize(), 1)
评论列表
文章目录