5 ms·
I used https://pypi.org/project/appdaemon-testing/ https://pypi.org/project/appdaemon-testing/. You can write a simple test file which does things like sets a d
by gregable 5y ago
I used https://pypi.org/project/appdaemon-testing/ https://pypi.org/project/appdaemon-testing/. You can write a simple test file which does things like sets a device state, then asserts that services were called or whatnot.
It doesn't test that the service calls are correctly written, just that they were made. So, very useful for unit testing syntax / logic, but not a full end-to-end integration test solution. Still, with python being an interpreted language, this is super useful. I don't want to have to wait for it actually to be sunset to determine I have a syntax error in that branch of the code, for example.
I don't actually have the tests running on the HA device. I have them on my desktop where I develop the appdaemon scripts, and then I copy only the scripts over to HA. I'm sure there are multiple ways to do it.
- ornornor 5y agoThank you, that’s helpful.