test_blockchain.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:crankycoin 作者: cranklin 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号