diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..665af6d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +*/__pycache__/ +*.pyc +.DS_Store diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ee7c991 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM python:3 + +COPY requirements.txt . +RUN pip install -r requirements.txt + +COPY tests ./tests +COPY custom_components ./custom_components + +RUN python3 -m unittest discover -s tests -p "*_test.py" diff --git a/requirements.txt b/requirements.txt index 76f0ada..22c6869 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,10 @@ homeassistant bleak_retry_connector pyserial bluetooth_auto_recovery -crcmod \ No newline at end of file +crcmod +typing +asyncio +logging +bleak +async_timeout +aiousbwatcher \ No newline at end of file diff --git a/test.sh b/test.sh index 90b73db..b6595eb 100755 --- a/test.sh +++ b/test.sh @@ -1,4 +1,4 @@ #!/bin/sh -# Execute unittests of python library -python3 -m unittest discover -s tests -p "*_test.py" +# Execute unittests of python library inside docker +sudo docker build --progress=plain -t bluetti-bt-tests .