Compare commits

..

2 Commits

Author SHA1 Message Date
Gilles Boccon-Gibod 368e7eff05 update tests to look at side effects instead of internals 2022-08-12 12:32:36 -07:00
Gilles Boccon-Gibod 55b813bbf5 don't use a lambda as a subscriber 2022-08-12 12:06:08 -07:00
6 changed files with 22 additions and 43 deletions
+2 -2
View File
@@ -29,11 +29,11 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install ".[build,test,development,documentation]"
python -m pip install ".[test,development,documentation]"
- name: Test with pytest
run: |
pytest
- name: Build
run: |
inv build
inv build.mkdocs
inv mkdocs
+1 -1
View File
@@ -20,11 +20,11 @@ import logging
import struct
from colors import color
from pyee import EventEmitter
from .core import BT_CENTRAL_ROLE, InvalidStateError, ProtocolError
from .hci import (HCI_LE_Connection_Update_Command, HCI_Object, key_with_value,
name_or_number)
from .utils import EventEmitter
# -----------------------------------------------------------------------------
# Logging
+1 -2
View File
@@ -17,10 +17,9 @@
# -----------------------------------------------------------------------------
import logging
import asyncio
from colors import color
from pyee import EventEmitter
from .utils import EventEmitter
from .core import InvalidStateError, ProtocolError, ConnectionError
# -----------------------------------------------------------------------------
+2 -4
View File
@@ -7,12 +7,10 @@ The Console app is an interactive text user interface that offers a number of fu
* scanning
* advertising
* connecting to and disconnecting from devices
* connecting to devices
* changing connection parameters
* enabling encryption
* discovering GATT services and characteristics
* reading and writing GATT characteristics
* subscribing to and unsubscribing from GATT characteristics
* read & write GATT characteristics
The console user interface has 3 main panes:
+1 -2
View File
@@ -57,13 +57,12 @@ console_scripts =
bumble-link-relay = bumble.apps.link_relay.link_relay:main
[options.extras_require]
build =
build >= 0.7
test =
pytest >= 6.2
pytest-asyncio >= 0.17
development =
invoke >= 1.4
build >= 0.7
nox >= 2022
documentation =
mkdocs >= 1.2.3
+15 -32
View File
@@ -23,52 +23,35 @@ ROOT_DIR = os.path.dirname(os.path.realpath(__file__))
ns = Collection()
# Building
build_tasks = Collection()
ns.add_collection(build_tasks, name="build")
ns.add_collection(build_tasks, name='build')
@task
def build(ctx, install=False):
if install:
ctx.run('python -m pip install .[build]')
def build(ctx):
ctx.run('python -m build')
ctx.run("python -m build")
build_tasks.add_task(build, default=True, name='build')
build_tasks.add_task(build, default=True)
@task
def release_build(ctx):
build(ctx, install=True)
build_tasks.add_task(release_build, name="release")
@task
def mkdocs(ctx):
ctx.run("mkdocs build -f docs/mkdocs/mkdocs.yml")
build_tasks.add_task(mkdocs, name="mkdocs")
# Testing
test_tasks = Collection()
ns.add_collection(test_tasks, name="test")
ns.add_collection(test_tasks, name='test')
@task
def test(ctx, filter=None, junit=False, install=False):
# Install the package before running the tests
if install:
ctx.run("python -m pip install .[test]")
def test(ctx, filter=None, junit=False):
args = ""
if junit:
args += "--junit-xml test-results.xml"
if filter is not None:
args += " -k '{}'".format(filter)
ctx.run("python -m pytest {} {}".format(os.path.join(ROOT_DIR, "tests"), args))
ctx.run('python -m pytest {} {}'
.format(os.path.join(ROOT_DIR, "tests"), args))
test_tasks.add_task(test, name='test', default=True)
test_tasks.add_task(test, default=True)
@task
def release_test(ctx):
test(ctx, install=True)
def mkdocs(ctx):
ctx.run('mkdocs build -f docs/mkdocs/mkdocs.yml')
test_tasks.add_task(release_test, name="release")
ns.add_task(mkdocs)