Onionr/src/runtests/inserttest.py

22 lines
538 B
Python
Raw Normal View History

2019-10-07 05:51:30 +00:00
import os
import time
2019-10-07 05:51:30 +00:00
import onionrblocks
import logger
import coredb
from communicator import peeraction
2019-10-07 05:51:30 +00:00
2019-10-11 09:28:43 +00:00
def _check_remote_node(testmanager):
return
2019-10-11 09:28:43 +00:00
2019-10-07 05:51:30 +00:00
def insert_bin_test(testmanager):
data = os.urandom(32)
b_hash = onionrblocks.insert(data)
time.sleep(0.3)
if b_hash not in testmanager._too_many.get_by_string("PublicAPI").hideBlocks:
raise ValueError("Block not hidden")
2019-10-11 09:28:43 +00:00
if b_hash not in coredb.blockmetadb.get_block_list():
2019-10-07 05:51:30 +00:00
logger.error(str(b_hash) + 'is not in bl')
2019-10-11 09:28:43 +00:00
raise ValueError