Refactor & add unittests for almost all functionality, add tox for running tests on py27 and py35 (#17)
* Refactor & add unittests for almost all functionality, add tox for running tests on py27 and py35
This commit adds unit tests for current api functionality.
- currently no mocking, all tests are run on the device.
- the library is now compatible with python 2.7 and python 3.5, use tox for tests
- schema checks are done with voluptuous
refactoring:
- protocol is separated into its own file, smartplug adapted to receive protocol worker as parameter.
- cleaned up the initialization routine, initialization is done on use, not on creation of smartplug
- added model and features properties, identity kept for backwards compatibility
- no more storing of local variables outside _sys_info, paves a way to handle state changes sanely (without complete reinitialization)
* Fix CI warnings, remove unused leftover code
* Rename _initialize to _fetch_sysinfo, as that's what it does.
* examples.cli: fix identify call, prettyprint sysinfo, update readme which had false format for led setting
* Add tox-travis for automated testing.
2016-12-16 22:51:56 +00:00
|
|
|
[tox]
|
2023-10-29 22:15:42 +00:00
|
|
|
envlist=py37,py38,lint,coverage
|
2017-10-07 15:44:45 +00:00
|
|
|
skip_missing_interpreters = True
|
2020-05-12 10:11:47 +00:00
|
|
|
isolated_build = True
|
Refactor & add unittests for almost all functionality, add tox for running tests on py27 and py35 (#17)
* Refactor & add unittests for almost all functionality, add tox for running tests on py27 and py35
This commit adds unit tests for current api functionality.
- currently no mocking, all tests are run on the device.
- the library is now compatible with python 2.7 and python 3.5, use tox for tests
- schema checks are done with voluptuous
refactoring:
- protocol is separated into its own file, smartplug adapted to receive protocol worker as parameter.
- cleaned up the initialization routine, initialization is done on use, not on creation of smartplug
- added model and features properties, identity kept for backwards compatibility
- no more storing of local variables outside _sys_info, paves a way to handle state changes sanely (without complete reinitialization)
* Fix CI warnings, remove unused leftover code
* Rename _initialize to _fetch_sysinfo, as that's what it does.
* examples.cli: fix identify call, prettyprint sysinfo, update readme which had false format for led setting
* Add tox-travis for automated testing.
2016-12-16 22:51:56 +00:00
|
|
|
|
2017-01-17 13:38:44 +00:00
|
|
|
|
Refactor & add unittests for almost all functionality, add tox for running tests on py27 and py35 (#17)
* Refactor & add unittests for almost all functionality, add tox for running tests on py27 and py35
This commit adds unit tests for current api functionality.
- currently no mocking, all tests are run on the device.
- the library is now compatible with python 2.7 and python 3.5, use tox for tests
- schema checks are done with voluptuous
refactoring:
- protocol is separated into its own file, smartplug adapted to receive protocol worker as parameter.
- cleaned up the initialization routine, initialization is done on use, not on creation of smartplug
- added model and features properties, identity kept for backwards compatibility
- no more storing of local variables outside _sys_info, paves a way to handle state changes sanely (without complete reinitialization)
* Fix CI warnings, remove unused leftover code
* Rename _initialize to _fetch_sysinfo, as that's what it does.
* examples.cli: fix identify call, prettyprint sysinfo, update readme which had false format for led setting
* Add tox-travis for automated testing.
2016-12-16 22:51:56 +00:00
|
|
|
[testenv]
|
2020-05-12 10:11:47 +00:00
|
|
|
whitelist_externals =
|
|
|
|
poetry
|
|
|
|
coverage
|
|
|
|
commands =
|
|
|
|
poetry install -v
|
|
|
|
poetry run pytest --cov kasa/tests/
|
|
|
|
|
|
|
|
[testenv:clean]
|
|
|
|
deps = coverage
|
|
|
|
skip_install = true
|
|
|
|
commands = coverage erase
|
|
|
|
|
|
|
|
[testenv:py37]
|
|
|
|
commands = coverage run -m pytest {posargs}
|
|
|
|
|
|
|
|
[testenv:py38]
|
|
|
|
commands = coverage run -m pytest {posargs}
|
|
|
|
|
|
|
|
[testenv:coverage]
|
|
|
|
basepython = python3.8
|
|
|
|
skip_install = true
|
|
|
|
deps = coverage[toml]
|
|
|
|
commands =
|
|
|
|
coverage report
|
|
|
|
coverage html
|
2017-01-17 13:38:44 +00:00
|
|
|
|
2019-11-11 21:14:34 +00:00
|
|
|
[testenv:lint]
|
|
|
|
deps = pre-commit
|
|
|
|
skip_install = true
|
|
|
|
commands = pre-commit run --all-files
|