示例#1
0
 def test_get_unspent_test_used(self):
     assert len(
         BlockstreamAPI.get_unspent_testnet(TEST_ADDRESS_USED2)) >= 196
示例#2
0
 def test_get_unspent_test_unused(self):
     assert len(
         BlockstreamAPI.get_unspent_testnet(TEST_ADDRESS_UNUSED)) == 0
示例#3
0
 def test_get_unspent_main_too_many(self):
     with pytest.raises(bit.exceptions.ExcessiveAddress):
         BlockstreamAPI.get_unspent(MAIN_ADDRESS_USED3)
示例#4
0
 def test_get_unspent_main_unused(self):
     assert len(BlockstreamAPI.get_unspent(MAIN_ADDRESS_UNUSED)) == 0
示例#5
0
 def test_get_transaction_by_id_test_invalid(self):
     assert BlockstreamAPI.get_transaction_by_id_testnet(TX_INVALID) == None
示例#6
0
 def test_get_unspent_return_type(self):
     assert iter(BlockstreamAPI.get_unspent(MAIN_ADDRESS_USED1))
示例#7
0
 def test_get_transaction_by_id_valid(self):
     tx = BlockstreamAPI.get_transaction_by_id(MAIN_TX_VALID)
     assert calc_txid(tx) == MAIN_TX_VALID
示例#8
0
 def test_get_transaction_by_id_test_valid(self):
     tx = BlockstreamAPI.get_transaction_by_id_testnet(TEST_TX_VALID)
     assert calc_txid(tx) == TEST_TX_VALID
示例#9
0
 def test_get_transactions_main_unused(self):
     assert len(BlockstreamAPI.get_transactions(MAIN_ADDRESS_UNUSED)) == 0
示例#10
0
 def test_get_transactions_test_used(self):
     assert len(
         BlockstreamAPI.get_transactions_testnet(TEST_ADDRESS_USED2)) >= 444
示例#11
0
 def test_get_transactions_main_used(self):
     assert len(BlockstreamAPI.get_transactions(MAIN_ADDRESS_USED1)) >= 236
示例#12
0
 def test_get_transactions_return_type(self):
     assert iter(BlockstreamAPI.get_transactions(MAIN_ADDRESS_USED1))
示例#13
0
 def test_get_balance_test_unused(self):
     assert BlockstreamAPI.get_balance_testnet(TEST_ADDRESS_UNUSED) == 0
示例#14
0
 def test_get_balance_main_unused(self):
     assert BlockstreamAPI.get_balance(MAIN_ADDRESS_UNUSED) == 0
示例#15
0
 def test_get_balance_return_type(self):
     assert isinstance(BlockstreamAPI.get_balance(MAIN_ADDRESS_USED1), int)