Skip to content

Latest commit

 

History

History
46 lines (35 loc) · 998 Bytes

Tests.md

File metadata and controls

46 lines (35 loc) · 998 Bytes

Testing

setting up test environment

sudo apt install libgirepository1.0-dev gcc libcairo2-dev pkg-config gir1.2-gtk-3.0 libdbus-1-dev python3-dev python3-pip
pip3 install --user virtualenv
virtualenv tests_env
source tests_env/bin/activate
pip install -r requirements.txt 

Use docker to run the tests in a container:

# build image
docker build -t homekit_tests -f ./Dockerfile_tests  .

# start container
docker run --rm -ti homekit_tests

Running unit tests

coverage3 run --branch -m unittest -v ; coverage3 html

Style checker

flake8 homekit tests

Test pair & unpair

Bluetooth LE

PYTHONPATH=. python3 homekit/pair_ble.py -f ble.json -a DW1 -m e2:a3:cb:26:77:61 -p 893-01-591;\
PYTHONPATH=. python3 homekit/unpair.py -f ble.json -a DW1

IP

PYTHONPATH=. python3 homekit/pair.py -f controller.json -a esp -d EC:73:A0:BD:97:22 -p 111-11-111;\
PYTHONPATH=. python3 homekit/unpair.py -f controller.json -a esp