mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-04-30 18:46:24 +00:00
Move tests folder to top level of project (#1242)
This commit is contained in:
parent
e5dd874333
commit
32671da9e9
devtools
docs/source
pyproject.tomltests
__init__.pyconftest.pydevice_fixtures.pydiscovery_fixtures.pyfakeprotocol_iot.pyfakeprotocol_smart.pyfakeprotocol_smartcamera.pyfixtureinfo.py
fixtures
EP10(US)_1.0_1.0.2.jsonEP40(US)_1.0_1.0.2.jsonES20M(US)_1.0_1.0.11.jsonES20M(US)_1.0_1.0.8.jsonHS100(UK)_1.0_1.2.6.jsonHS100(UK)_4.1_1.1.0.jsonHS100(US)_1.0_1.2.5.jsonHS100(US)_2.0_1.5.6.jsonHS103(US)_1.0_1.5.7.jsonHS103(US)_2.1_1.1.2.jsonHS103(US)_2.1_1.1.4.jsonHS105(US)_1.0_1.5.6.jsonHS107(US)_1.0_1.0.8.jsonHS110(EU)_1.0_1.2.5.jsonHS110(EU)_4.0_1.0.4.jsonHS110(US)_1.0_1.2.6.jsonHS200(US)_2.0_1.5.7.jsonHS200(US)_3.0_1.1.5.jsonHS200(US)_5.0_1.0.11.jsonHS200(US)_5.0_1.0.2.jsonHS210(US)_1.0_1.5.8.jsonHS210(US)_2.0_1.1.5.jsonHS220(US)_1.0_1.5.7.jsonHS220(US)_2.0_1.0.3.jsonHS300(US)_1.0_1.0.10.jsonHS300(US)_1.0_1.0.21.jsonHS300(US)_2.0_1.0.12.jsonHS300(US)_2.0_1.0.3.jsonKL110(US)_1.0_1.8.11.jsonKL120(US)_1.0_1.8.11.jsonKL120(US)_1.0_1.8.6.jsonKL125(US)_1.20_1.0.5.jsonKL125(US)_2.0_1.0.7.jsonKL125(US)_4.0_1.0.5.jsonKL130(EU)_1.0_1.8.8.jsonKL130(US)_1.0_1.8.11.jsonKL135(US)_1.0_1.0.15.jsonKL135(US)_1.0_1.0.6.jsonKL400L5(US)_1.0_1.0.5.jsonKL400L5(US)_1.0_1.0.8.jsonKL420L5(US)_1.0_1.0.2.jsonKL430(UN)_2.0_1.0.8.jsonKL430(US)_1.0_1.0.10.jsonKL430(US)_2.0_1.0.11.jsonKL430(US)_2.0_1.0.8.jsonKL430(US)_2.0_1.0.9.jsonKL50(US)_1.0_1.1.13.jsonKL60(UN)_1.0_1.1.4.jsonKL60(US)_1.0_1.1.13.jsonKP100(US)_3.0_1.0.1.jsonKP105(UK)_1.0_1.0.5.jsonKP105(UK)_1.0_1.0.7.jsonKP115(EU)_1.0_1.0.16.jsonKP115(US)_1.0_1.0.17.jsonKP115(US)_1.0_1.0.21.jsonKP125(US)_1.0_1.0.6.jsonKP200(US)_3.0_1.0.3.jsonKP303(UK)_1.0_1.0.3.jsonKP303(US)_2.0_1.0.3.jsonKP303(US)_2.0_1.0.9.jsonKP400(US)_1.0_1.0.10.jsonKP400(US)_2.0_1.0.6.jsonKP400(US)_3.0_1.0.3.jsonKP400(US)_3.0_1.0.4.jsonKP401(US)_1.0_1.0.0.jsonKP405(US)_1.0_1.0.5.jsonKP405(US)_1.0_1.0.6.jsonKS200M(US)_1.0_1.0.10.jsonKS200M(US)_1.0_1.0.11.jsonKS200M(US)_1.0_1.0.12.jsonKS200M(US)_1.0_1.0.8.jsonKS220(US)_1.0_1.0.13.jsonKS220M(US)_1.0_1.0.4.jsonKS230(US)_1.0_1.0.14.jsonLB110(US)_1.0_1.8.11.json
smart
EP25(US)_2.6_1.0.1.jsonEP25(US)_2.6_1.0.2.jsonEP40M(US)_1.0_1.1.0.jsonH100(EU)_1.0_1.2.3.jsonH100(EU)_1.0_1.5.10.jsonH100(EU)_1.0_1.5.5.jsonHS220(US)_3.26_1.0.1.jsonKH100(EU)_1.0_1.2.3.jsonKH100(EU)_1.0_1.5.12.jsonKH100(UK)_1.0_1.5.6.jsonKP125M(US)_1.0_1.1.3.jsonKP125M(US)_1.0_1.2.3.jsonKS205(US)_1.0_1.0.2.json
@ -1,7 +1,7 @@
|
||||
"""This script generates devinfo files for the test suite.
|
||||
|
||||
If you have new, yet unsupported device or a device with no devinfo file under
|
||||
kasa/tests/fixtures, feel free to run this script and create a PR to add the file
|
||||
tests/fixtures, feel free to run this script and create a PR to add the file
|
||||
to the repository.
|
||||
|
||||
Executing this script will several modules and methods one by one,
|
||||
@ -50,10 +50,10 @@ from kasa.smartprotocol import SmartProtocol, _ChildProtocolWrapper
|
||||
Call = namedtuple("Call", "module method")
|
||||
FixtureResult = namedtuple("FixtureResult", "filename, folder, data")
|
||||
|
||||
SMART_FOLDER = "kasa/tests/fixtures/smart/"
|
||||
SMARTCAMERA_FOLDER = "kasa/tests/fixtures/smartcamera/"
|
||||
SMART_CHILD_FOLDER = "kasa/tests/fixtures/smart/child/"
|
||||
IOT_FOLDER = "kasa/tests/fixtures/"
|
||||
SMART_FOLDER = "tests/fixtures/smart/"
|
||||
SMARTCAMERA_FOLDER = "tests/fixtures/smartcamera/"
|
||||
SMART_CHILD_FOLDER = "tests/fixtures/smart/child/"
|
||||
IOT_FOLDER = "tests/fixtures/"
|
||||
|
||||
ENCRYPT_TYPES = [encrypt_type.value for encrypt_type in DeviceEncryptionType]
|
||||
|
||||
|
@ -41,8 +41,8 @@ DEVICE_TYPE_TO_PRODUCT_GROUP = {
|
||||
SUPPORTED_FILENAME = "SUPPORTED.md"
|
||||
README_FILENAME = "README.md"
|
||||
|
||||
IOT_FOLDER = "kasa/tests/fixtures/"
|
||||
SMART_FOLDER = "kasa/tests/fixtures/smart/"
|
||||
IOT_FOLDER = "tests/fixtures/"
|
||||
SMART_FOLDER = "tests/fixtures/smart/"
|
||||
|
||||
|
||||
def generate_supported(args):
|
||||
|
@ -59,7 +59,7 @@ One of the easiest ways to contribute is by creating a fixture file and uploadin
|
||||
These files will help us to improve the library and run tests against devices that we have no access to.
|
||||
|
||||
This library is tested against responses from real devices ("fixture files").
|
||||
These files contain responses for selected, known device commands and are stored [in our test suite](https://github.com/python-kasa/python-kasa/tree/master/kasa/tests/fixtures).
|
||||
These files contain responses for selected, known device commands and are stored [in our test suite](https://github.com/python-kasa/python-kasa/tree/master/tests/fixtures).
|
||||
|
||||
You can generate these files by using the `dump_devinfo.py` script.
|
||||
Note, that this script should be run inside the main source directory so that the generated files are stored in the correct directories.
|
||||
|
@ -71,6 +71,7 @@ include = [
|
||||
"/kasa",
|
||||
"/devtools",
|
||||
"/docs",
|
||||
"/tests",
|
||||
"/CHANGELOG.md",
|
||||
]
|
||||
|
||||
@ -78,15 +79,11 @@ include = [
|
||||
include = [
|
||||
"/kasa",
|
||||
]
|
||||
exclude = [
|
||||
"/kasa/tests",
|
||||
]
|
||||
|
||||
[tool.coverage.run]
|
||||
source = ["kasa"]
|
||||
branch = true
|
||||
omit = [
|
||||
"kasa/tests/*",
|
||||
"kasa/experimental/*"
|
||||
]
|
||||
|
||||
@ -107,6 +104,9 @@ exclude_lines = [
|
||||
]
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
testpaths = [
|
||||
"tests",
|
||||
]
|
||||
markers = [
|
||||
"requires_dummy: test requires dummy data to pass, skipped on real devices",
|
||||
]
|
||||
@ -154,7 +154,7 @@ ignore = [
|
||||
convention = "pep257"
|
||||
|
||||
[tool.ruff.lint.per-file-ignores]
|
||||
"kasa/tests/*.py" = [
|
||||
"tests/*.py" = [
|
||||
"D100",
|
||||
"D101",
|
||||
"D102",
|
||||
|
@ -1,9 +1,9 @@
|
||||
import copy
|
||||
import logging
|
||||
|
||||
from ..deviceconfig import DeviceConfig
|
||||
from ..iotprotocol import IotProtocol
|
||||
from ..protocol import BaseTransport
|
||||
from kasa.deviceconfig import DeviceConfig
|
||||
from kasa.iotprotocol import IotProtocol
|
||||
from kasa.protocol import BaseTransport
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
0
kasa/tests/fixtures/KL400L5(US)_1.0_1.0.5.json → tests/fixtures/KL400L5(US)_1.0_1.0.5.json
vendored
0
kasa/tests/fixtures/KL400L5(US)_1.0_1.0.5.json → tests/fixtures/KL400L5(US)_1.0_1.0.5.json
vendored
0
kasa/tests/fixtures/KL400L5(US)_1.0_1.0.8.json → tests/fixtures/KL400L5(US)_1.0_1.0.8.json
vendored
0
kasa/tests/fixtures/KL400L5(US)_1.0_1.0.8.json → tests/fixtures/KL400L5(US)_1.0_1.0.8.json
vendored
0
kasa/tests/fixtures/KL420L5(US)_1.0_1.0.2.json → tests/fixtures/KL420L5(US)_1.0_1.0.2.json
vendored
0
kasa/tests/fixtures/KL420L5(US)_1.0_1.0.2.json → tests/fixtures/KL420L5(US)_1.0_1.0.2.json
vendored
0
kasa/tests/fixtures/KS200M(US)_1.0_1.0.10.json → tests/fixtures/KS200M(US)_1.0_1.0.10.json
vendored
0
kasa/tests/fixtures/KS200M(US)_1.0_1.0.10.json → tests/fixtures/KS200M(US)_1.0_1.0.10.json
vendored
0
kasa/tests/fixtures/KS200M(US)_1.0_1.0.11.json → tests/fixtures/KS200M(US)_1.0_1.0.11.json
vendored
0
kasa/tests/fixtures/KS200M(US)_1.0_1.0.11.json → tests/fixtures/KS200M(US)_1.0_1.0.11.json
vendored
0
kasa/tests/fixtures/KS200M(US)_1.0_1.0.12.json → tests/fixtures/KS200M(US)_1.0_1.0.12.json
vendored
0
kasa/tests/fixtures/KS200M(US)_1.0_1.0.12.json → tests/fixtures/KS200M(US)_1.0_1.0.12.json
vendored
0
kasa/tests/fixtures/smart/EP25(US)_2.6_1.0.1.json → tests/fixtures/smart/EP25(US)_2.6_1.0.1.json
vendored
0
kasa/tests/fixtures/smart/EP25(US)_2.6_1.0.1.json → tests/fixtures/smart/EP25(US)_2.6_1.0.1.json
vendored
0
kasa/tests/fixtures/smart/EP25(US)_2.6_1.0.2.json → tests/fixtures/smart/EP25(US)_2.6_1.0.2.json
vendored
0
kasa/tests/fixtures/smart/EP25(US)_2.6_1.0.2.json → tests/fixtures/smart/EP25(US)_2.6_1.0.2.json
vendored
0
kasa/tests/fixtures/smart/EP40M(US)_1.0_1.1.0.json → tests/fixtures/smart/EP40M(US)_1.0_1.1.0.json
vendored
0
kasa/tests/fixtures/smart/EP40M(US)_1.0_1.1.0.json → tests/fixtures/smart/EP40M(US)_1.0_1.1.0.json
vendored
0
kasa/tests/fixtures/smart/H100(EU)_1.0_1.2.3.json → tests/fixtures/smart/H100(EU)_1.0_1.2.3.json
vendored
0
kasa/tests/fixtures/smart/H100(EU)_1.0_1.2.3.json → tests/fixtures/smart/H100(EU)_1.0_1.2.3.json
vendored
0
kasa/tests/fixtures/smart/H100(EU)_1.0_1.5.10.json → tests/fixtures/smart/H100(EU)_1.0_1.5.10.json
vendored
0
kasa/tests/fixtures/smart/H100(EU)_1.0_1.5.10.json → tests/fixtures/smart/H100(EU)_1.0_1.5.10.json
vendored
0
kasa/tests/fixtures/smart/H100(EU)_1.0_1.5.5.json → tests/fixtures/smart/H100(EU)_1.0_1.5.5.json
vendored
0
kasa/tests/fixtures/smart/H100(EU)_1.0_1.5.5.json → tests/fixtures/smart/H100(EU)_1.0_1.5.5.json
vendored
0
kasa/tests/fixtures/smart/HS220(US)_3.26_1.0.1.json → tests/fixtures/smart/HS220(US)_3.26_1.0.1.json
vendored
0
kasa/tests/fixtures/smart/HS220(US)_3.26_1.0.1.json → tests/fixtures/smart/HS220(US)_3.26_1.0.1.json
vendored
0
kasa/tests/fixtures/smart/KH100(EU)_1.0_1.2.3.json → tests/fixtures/smart/KH100(EU)_1.0_1.2.3.json
vendored
0
kasa/tests/fixtures/smart/KH100(EU)_1.0_1.2.3.json → tests/fixtures/smart/KH100(EU)_1.0_1.2.3.json
vendored
0
kasa/tests/fixtures/smart/KH100(EU)_1.0_1.5.12.json → tests/fixtures/smart/KH100(EU)_1.0_1.5.12.json
vendored
0
kasa/tests/fixtures/smart/KH100(EU)_1.0_1.5.12.json → tests/fixtures/smart/KH100(EU)_1.0_1.5.12.json
vendored
0
kasa/tests/fixtures/smart/KH100(UK)_1.0_1.5.6.json → tests/fixtures/smart/KH100(UK)_1.0_1.5.6.json
vendored
0
kasa/tests/fixtures/smart/KH100(UK)_1.0_1.5.6.json → tests/fixtures/smart/KH100(UK)_1.0_1.5.6.json
vendored
0
kasa/tests/fixtures/smart/KP125M(US)_1.0_1.1.3.json → tests/fixtures/smart/KP125M(US)_1.0_1.1.3.json
vendored
0
kasa/tests/fixtures/smart/KP125M(US)_1.0_1.1.3.json → tests/fixtures/smart/KP125M(US)_1.0_1.1.3.json
vendored
0
kasa/tests/fixtures/smart/KP125M(US)_1.0_1.2.3.json → tests/fixtures/smart/KP125M(US)_1.0_1.2.3.json
vendored
0
kasa/tests/fixtures/smart/KP125M(US)_1.0_1.2.3.json → tests/fixtures/smart/KP125M(US)_1.0_1.2.3.json
vendored
0
kasa/tests/fixtures/smart/KS205(US)_1.0_1.0.2.json → tests/fixtures/smart/KS205(US)_1.0_1.0.2.json
vendored
0
kasa/tests/fixtures/smart/KS205(US)_1.0_1.0.2.json → tests/fixtures/smart/KS205(US)_1.0_1.0.2.json
vendored
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user