| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Codecov ReportAll modified and coverable lines are covered by tests ✅ Additional details and impacted files @@ Coverage Diff @@
## master #567 +/- ##
=======================================
Coverage 79.56% 79.56%
=======================================
Files 37 37
Lines 3083 3083
Branches 804 804
=======================================
Hits 2453 2453
Misses 548 548
Partials 82 82 ☔ View full report in Codecov by Sentry. |
Sorry, something went wrong.
Co-authored-by: Teemu R. <tpr@iki.fi>
Co-authored-by: Teemu R. <tpr@iki.fi>
@rytilahti If I run with -k KP125M, all tests are skipped. If I point it at a device --ip $IP --username "$USERNAME" --password "$PASSWORD", I get: Results (0.80s): It looks like I'm missing some magic to make WITH_EMETER work properly. |
Sorry, something went wrong.
|
Related https://github.com/python-kasa/python-kasa/pull/566, but I think there's no need to recreate the file as it's just filename changes. |
Sorry, something went wrong.
|
@sbytnar ah, sorry, the test harness is currently in a bit of flux due to the new protocols being added. The new fixture is not picked as it's categorized as a "SMART" device while the has_emeter filters only "IOT" devices. This patch will fix that (and cause the tests to fail :-(): diff --git a/kasa/tests/conftest.py b/kasa/tests/conftest.py
index 53e2c49..f77c13b 100644
--- a/kasa/tests/conftest.py
+++ b/kasa/tests/conftest.py
@@ -151,7 +151,7 @@ def parametrize(desc, devices, protocol_filter=None, ids=None):
)
-has_emeter = parametrize("has emeter", WITH_EMETER)
+has_emeter = parametrize("has emeter", WITH_EMETER, protocol_filter={"SMART", "IOT"})
no_emeter = parametrize("no emeter", ALL_DEVICES_IOT - WITH_EMETER)
bulb = parametrize("bulbs", BULBS, protocol_filter={"SMART", "IOT"})
The problem is that the tests are written to test the internal structure which differs from what KP125M reports. We can leave it as-is (i.e., not testing these for the time being) for this PR and fix that later on. The tests that are failing are checking for the device responses which differ, so we would need to guard those checks by adding a new has_emeter_iot "group" to use for those tests. |
Sorry, something went wrong.
|
This LGTM and ready to merge. qq. you've masked nickname. Do you think we should mask all nicknames/aliases in dump_devinfo? We currently don't but maybe we should. Especially because if people try to mask nickname themselves they could put a non base64 value in there. |
Sorry, something went wrong.
|
Okay, let's merge this. @sdb9696, yeah, it probably makes sense to mask the name as it might be personalized & not having it masked doesn't bring any benefits that I can think of. |
Sorry, something went wrong.
…sa#567) * Add KP125M fixture. Enable tapo auth in pytest. * authentication is not just for tapo * Use "##MASKEDNAME##" base64 for nickname and ssid. --------- Co-authored-by: Teemu R. <tpr@iki.fi>
| Back | FazBrowse Home | New Git URL |
Is this the right way to add KP125M to conftest.py? Does this correctly test emeter?
Tested with:
$ poetry run pytest
...
Results (61.71s (0:01:01)):
7984 passed
110 skipped
$ poetry run pytest --ip $IP --username $USERNAME --password $PASSWORD
...
Results (22.73s):
1276 passed
6818 skipped