mirror of
https://github.com/aljazceru/python-teos.git
synced 2025-12-18 22:54:23 +01:00
Update tests to use bitcoind_sim event-wise
Also clean son unused imports
This commit is contained in:
@@ -1,14 +1,15 @@
|
||||
import pytest
|
||||
import requests
|
||||
from time import sleep
|
||||
from threading import Thread
|
||||
|
||||
from pisa.api import start_api
|
||||
from test2.simulator.bitcoind_sim import run_simulator
|
||||
from test.simulator.bitcoind_sim import run_simulator, HOST, PORT
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def run_bitcoind():
|
||||
bitcoind_thread = Thread(target=run_simulator)
|
||||
bitcoind_thread = Thread(target=run_simulator, kwargs={"mode": "event"})
|
||||
bitcoind_thread.daemon = True
|
||||
bitcoind_thread.start()
|
||||
|
||||
@@ -24,3 +25,10 @@ def run_api():
|
||||
|
||||
# It takes a little bit of time to start the API (otherwise the requests are sent too early and they fail)
|
||||
sleep(0.1)
|
||||
|
||||
|
||||
def generate_block():
|
||||
requests.post(url="http://{}:{}/generate".format(HOST, PORT), timeout=5)
|
||||
sleep(0.5)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user