work on runtime tests and onboarding
This commit is contained in:
parent
dbb306d7ee
commit
c22f084315
6 changed files with 259 additions and 6 deletions
|
@ -45,9 +45,9 @@ def insert_block(data: Union[str, bytes], header: str ='txt',
|
|||
with open(filepaths.data_nonce_file, 'a') as nonceFile:
|
||||
nonceFile.write(dataNonce + '\n')
|
||||
|
||||
if type(data) is bytes:
|
||||
data = data.decode()
|
||||
data = str(data)
|
||||
#if type(data) is bytes:
|
||||
# data = data.decode()
|
||||
#data = str(data)
|
||||
plaintext = data
|
||||
plaintextMeta = {}
|
||||
plaintextPeer = asymPeer
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
import logger
|
||||
from onionrutils import epoch
|
||||
|
||||
from . import uicheck
|
||||
from . import uicheck, inserttest
|
||||
|
||||
RUN_TESTS = [uicheck.check_ui]
|
||||
RUN_TESTS = [uicheck.check_ui, inserttest.insert_bin_test]
|
||||
|
||||
class OnionrRunTestManager:
|
||||
def __init__(self):
|
||||
|
|
13
onionr/runtests/inserttest.py
Normal file
13
onionr/runtests/inserttest.py
Normal file
|
@ -0,0 +1,13 @@
|
|||
import os
|
||||
|
||||
import onionrblocks
|
||||
import logger
|
||||
import coredb
|
||||
|
||||
def insert_bin_test(testmanager):
|
||||
data = os.urandom(32)
|
||||
b_hash = onionrblocks.insert(data, )
|
||||
|
||||
if not b_hash in coredb.blockmetadb.get_block_list():
|
||||
logger.error(str(b_hash) + 'is not in bl')
|
||||
raise ValueError
|
Loading…
Add table
Add a link
Reference in a new issue