A framework for Massa core dev to develop functional tests
from pathlib import Path
from massa_test_framework import ServerOpts, Server, Node
# init a Server (using your computer)
server_opts = ServerOpts(local=True)
server = Server(server_opts)
# create a Node object, use compilation from given path (assuming here it's compiled here in Sandbox mode)
node1 = Node.from_dev(server, repo=Path("~/dev/massa").expanduser())
# setup config
with node1.edit_config() as cfg:
cfg["logging"]["level"] = 3
# start node
with node1.start():
# Wait for node to be ready - aka node returns a valid last period
node1.wait_ready(20)
# Call get_status
status = node1.get_status()
print(status)
Create a virtualenv:
python3 -m venv venv_dev
Install dev requirements:
venv_dev/bin/python -m pip install -e __PATH_TO_MASSA_PROTO_PYTHON_REPO__
venv_dev/bin/python -m pip install -r requirements_dev.txt
Formatter black:
venv_dev/bin/black massa_test_framework
Typing mypy:
venv_dev/bin/mypy massa_test_framework
Linter ruff:
venv_dev/bin/ruff check massa_test_framework
Doc Sphinx:
cd doc && make html
Note: