Add bumble-console --device-config support for gatt services

This PR adds support for bumble-console to be preloaded with gatt services via `--device-config`.
This PR also adds some type annotations
This commit is contained in:
Alan Rosenthal
2022-11-28 14:11:27 -05:00
parent b437bd8619
commit f56ac14f2c
8 changed files with 118 additions and 17 deletions

View File

@@ -52,8 +52,9 @@ build_tasks.add_task(mkdocs, name="mkdocs")
test_tasks = Collection()
ns.add_collection(test_tasks, name="test")
@task
def test(ctx, filter=None, junit=False, install=False, html=False):
@task(incrementable=["verbose"])
def test(ctx, filter=None, junit=False, install=False, html=False, verbose=0):
# Install the package before running the tests
if install:
ctx.run("python -m pip install .[test]")
@@ -62,10 +63,12 @@ def test(ctx, filter=None, junit=False, install=False, html=False):
if junit:
args += "--junit-xml test-results.xml"
if filter is not None:
args += " -k '{}'".format(filter)
args += f" -k '{filter}'"
if html:
args += "--html results.html"
ctx.run("python -m pytest {} {}".format(os.path.join(ROOT_DIR, "tests"), args))
args += " --html results.html"
if verbose > 0:
args += f" -{'v' * verbose}"
ctx.run(f"python -m pytest {os.path.join(ROOT_DIR, 'tests')} {args}")
test_tasks.add_task(test, default=True)