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]
|
2019-11-11 21:14:34 +00:00
|
|
|
envlist=py35,py36,py37,flake8,linting,typing
|
2017-10-07 15:44:45 +00:00
|
|
|
skip_missing_interpreters = 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
|
|
|
|
|
|
|
[tox:travis]
|
|
|
|
3.5 = py35
|
2017-01-17 13:38:44 +00:00
|
|
|
3.6 = py36
|
2018-08-13 18:37:43 +00:00
|
|
|
3.7 = py37
|
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]
|
2017-08-09 11:07:24 +00:00
|
|
|
passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH
|
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
|
|
|
deps=
|
|
|
|
pytest
|
2017-08-09 11:07:24 +00:00
|
|
|
pytest-cov
|
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
|
|
|
voluptuous
|
2017-09-18 16:13:06 +00:00
|
|
|
typing
|
2019-12-12 09:41:52 +00:00
|
|
|
flake8
|
2020-01-12 21:44:19 +00:00
|
|
|
pytest-asyncio
|
2017-08-09 11:07:24 +00:00
|
|
|
commands=
|
2019-12-18 08:11:18 +00:00
|
|
|
py.test --cov --cov-config=tox.ini kasa
|
2017-01-17 13:38:44 +00:00
|
|
|
|
|
|
|
[testenv:flake8]
|
2019-11-11 21:14:34 +00:00
|
|
|
deps=
|
|
|
|
flake8
|
|
|
|
flake8-docstrings
|
2019-12-18 08:11:18 +00:00
|
|
|
commands=flake8 kasa
|
2017-01-17 13:38:44 +00:00
|
|
|
|
2017-09-18 16:13:06 +00:00
|
|
|
[testenv:typing]
|
2019-11-11 21:14:34 +00:00
|
|
|
skip_install=true
|
2017-09-18 16:13:06 +00:00
|
|
|
deps=mypy
|
2019-12-18 08:11:18 +00:00
|
|
|
commands=mypy --ignore-missing-imports kasa
|
2017-09-18 16:13:06 +00:00
|
|
|
|
2017-01-17 13:38:44 +00:00
|
|
|
[flake8]
|
2019-12-18 08:11:18 +00:00
|
|
|
exclude = .git,.tox,__pycache__,kasa/tests/newfakes.py,kasa/tests/test_fixtures.py
|
2019-11-11 21:14:34 +00:00
|
|
|
max-line-length = 88
|
|
|
|
per-file-ignores =
|
2019-12-18 08:11:18 +00:00
|
|
|
kasa/tests/*.py:D100,D101,D102,D103,D104
|
2019-11-11 21:14:34 +00:00
|
|
|
setup.py:D100
|
|
|
|
ignore = D105, D107, E203, E501, W503
|
|
|
|
#ignore = E203, E266, E501, W503, F403, F401
|
|
|
|
#max-complexity = 18
|
|
|
|
#select = B,C,E,F,W,T4,B9
|
|
|
|
|
|
|
|
[testenv:lint]
|
|
|
|
deps = pre-commit
|
|
|
|
skip_install = true
|
|
|
|
commands = pre-commit run --all-files
|
2018-08-13 18:37:43 +00:00
|
|
|
|
|
|
|
[coverage:run]
|
2019-12-18 08:11:18 +00:00
|
|
|
source = kasa
|
2018-08-13 18:37:43 +00:00
|
|
|
branch = True
|
|
|
|
omit =
|
2019-12-18 08:11:18 +00:00
|
|
|
kasa/cli.py
|
|
|
|
kasa/tests/*
|
2018-10-19 15:08:00 +00:00
|
|
|
|
|
|
|
[coverage:report]
|
|
|
|
exclude_lines =
|
|
|
|
# ignore abstract methods
|
|
|
|
raise NotImplementedError
|
|
|
|
def __repr__
|
2019-11-11 21:14:34 +00:00
|
|
|
|
|
|
|
[isort]
|
|
|
|
multi_line_output=3
|
|
|
|
include_trailing_comma=True
|
|
|
|
force_grid_wrap=0
|
|
|
|
use_parentheses=True
|
|
|
|
line_length=88
|
2019-12-18 08:11:18 +00:00
|
|
|
known_first_party=kasa
|
|
|
|
known_third_party=click,pytest,setuptools,voluptuous
|