Update docs with more howto examples (#968)

Co-authored-by: Teemu R. <tpr@iki.fi>
This commit is contained in:
Steven B
2024-06-19 09:53:40 +01:00
committed by GitHub
parent 6b46773609
commit 0d84d8785e
22 changed files with 646 additions and 86 deletions

View File

@@ -69,6 +69,7 @@ def test_discovery_examples(readmes_mock):
"""Test discovery examples."""
res = xdoctest.doctest_module("kasa.discover", "all")
assert res["n_passed"] > 0
assert res["n_warned"] == 0
assert not res["failed"]
@@ -76,6 +77,63 @@ def test_deviceconfig_examples(readmes_mock):
"""Test discovery examples."""
res = xdoctest.doctest_module("kasa.deviceconfig", "all")
assert res["n_passed"] > 0
assert res["n_warned"] == 0
assert not res["failed"]
def test_device_examples(readmes_mock):
"""Test device examples."""
res = xdoctest.doctest_module("kasa.device", "all")
assert res["n_passed"] > 0
assert res["n_warned"] == 0
assert not res["failed"]
def test_light_examples(readmes_mock):
"""Test device examples."""
res = xdoctest.doctest_module("kasa.interfaces.light", "all")
assert res["n_passed"] > 0
assert res["n_warned"] == 0
assert not res["failed"]
def test_light_preset_examples(readmes_mock):
"""Test device examples."""
res = xdoctest.doctest_module("kasa.interfaces.lightpreset", "all")
assert res["n_passed"] > 0
assert res["n_warned"] == 0
assert not res["failed"]
def test_light_effect_examples(readmes_mock):
"""Test device examples."""
res = xdoctest.doctest_module("kasa.interfaces.lighteffect", "all")
assert res["n_passed"] > 0
assert res["n_warned"] == 0
assert not res["failed"]
def test_child_examples(readmes_mock):
"""Test device examples."""
res = xdoctest.doctest_module("kasa.smart.modules.childdevice", "all")
assert res["n_passed"] > 0
assert res["n_warned"] == 0
assert not res["failed"]
def test_module_examples(readmes_mock):
"""Test device examples."""
res = xdoctest.doctest_module("kasa.module", "all")
assert res["n_passed"] > 0
assert res["n_warned"] == 0
assert not res["failed"]
def test_feature_examples(readmes_mock):
"""Test device examples."""
res = xdoctest.doctest_module("kasa.feature", "all")
assert res["n_passed"] > 0
assert res["n_warned"] == 0
assert not res["failed"]
@@ -83,6 +141,7 @@ def test_tutorial_examples(readmes_mock):
"""Test discovery examples."""
res = xdoctest.doctest_module("docs/tutorial.py", "all")
assert res["n_passed"] > 0
assert res["n_warned"] == 0
assert not res["failed"]