def setUp(self): MASTERNODE_DB.init(':memory:') MASTERNODE_DB.connect(reuse_if_open=True) MASTERNODE_DB.create_tables(DB_MODELS) Masternode.create( ext_address='127.0.0.1:444', pastel_id= 'jXZVtBmehoxYPotVrLdByFNNcB8jsryXhFPgqRa95i2x1mknbzSef1oGjnzfiwRtzReimfugvg41VtA7qGfDZR' ) Masternode.create( ext_address='127.0.0.1:4441', pastel_id= 'jXZVtBmehoxYPotVrLdByFNNcB7jsryXhFPgqRa95i2x1mknbzSef1oGjnzfiwRtzReimfugvg41VtA7qGfDZR' )
def setUp(self): # warnings.simplefilter('ignore') # MASTERNODE_DB.init(':memory:') # MASTERNODE_DB.connect(reuse_if_open=True) # MASTERNODE_DB.create_tables(DB_MODELS) switch_pastelid(CLIENT_PASTELID, PASSPHRASE) MASTERNODE_DB.init(':memory:') MASTERNODE_DB.connect(reuse_if_open=True) MASTERNODE_DB.create_tables(DB_MODELS) # cleanup chunk storage import shutil try: shutil.rmtree(Settings.CHUNK_DATA_DIR) shutil.rmtree(Settings.TEMP_STORAGE_DIR) except FileNotFoundError: pass
def setUp(self): MASTERNODE_DB.init(':memory:') MASTERNODE_DB.connect(reuse_if_open=True) MASTERNODE_DB.create_tables(DB_MODELS) for i in range(3): Masternode.create( ext_address='127.0.0.1:444{}'.format(i), pastel_id= 'jXZVtBmehoxYPotVrLdByFNNcB8jsryXhFPgqRa95i2x1mknbzSef1oGjnzfiwRtzReimfugvg41VtA7qGfDZ{}' .format(i)) Chunk.create( chunk_id= '1231231231231231232323934384834890089238429382938429384934{}'. format(i), image_hash=b'asdasdasd') index_new_chunks()
def create_database(): MASTERNODE_DB.init(Settings.MN_DATABASE_FILE) MASTERNODE_DB.connect(reuse_if_open=True) MASTERNODE_DB.create_tables(DB_MODELS)
def setUp(self): warnings.simplefilter('ignore') MASTERNODE_DB.init(':memory:') MASTERNODE_DB.connect(reuse_if_open=True) MASTERNODE_DB.create_tables(DB_MODELS)
def setUp(self): MASTERNODE_DB.init(':memory:') MASTERNODE_DB.connect(reuse_if_open=True) MASTERNODE_DB.create_tables(DB_MODELS)