mirror of
https://github.com/aljazceru/python-teos.git
synced 2026-02-01 12:44:25 +01:00
Apply requested changes
- Adds a PRG based on a hardcoded seed to make the tests reproducible (get_random_value_hex) - Updates all the tests replacing urandom for get_random_value_hex - Properly places misplaced bitcoin_cli in bitcoin_sim_tests - Typos
This commit is contained in:
@@ -1,15 +1,17 @@
|
||||
import re
|
||||
import os
|
||||
import pytest
|
||||
from time import sleep
|
||||
from threading import Thread
|
||||
|
||||
from test.simulator.transaction import TX
|
||||
from test.unit.conftest import get_random_value_hex
|
||||
from test.simulator.bitcoind_sim import run_simulator
|
||||
from pisa.utils.auth_proxy import AuthServiceProxy, JSONRPCException
|
||||
from pisa.conf import BTC_RPC_USER, BTC_RPC_PASSWD, BTC_RPC_HOST, BTC_RPC_PORT
|
||||
|
||||
MIXED_VALUES = values = [-1, 500, '', '111', [], 1.1, None, '', "a" * 31, "b" * 33, os.urandom(32).hex()]
|
||||
MIXED_VALUES = values = [-1, 500, '', '111', [], 1.1, None, '', "a" * 31, "b" * 33, get_random_value_hex(32)]
|
||||
|
||||
bitcoin_cli = AuthServiceProxy("http://%s:%s@%s:%d" % (BTC_RPC_USER, BTC_RPC_PASSWD, BTC_RPC_HOST, BTC_RPC_PORT))
|
||||
|
||||
|
||||
@pytest.fixture(scope='module')
|
||||
@@ -32,9 +34,6 @@ def check_hash_format(txid):
|
||||
return isinstance(txid, str) and re.search(r'^[0-9A-Fa-f]{64}$', txid) is not None
|
||||
|
||||
|
||||
bitcoin_cli = AuthServiceProxy("http://%s:%s@%s:%d" % (BTC_RPC_USER, BTC_RPC_PASSWD, BTC_RPC_HOST, BTC_RPC_PORT))
|
||||
|
||||
|
||||
def test_help(run_bitcoind):
|
||||
# Help should always return 0
|
||||
assert(bitcoin_cli.help() == 0)
|
||||
|
||||
Reference in New Issue
Block a user