Closed sl-wallace closed 2 years ago
(Will have a closer look in about a week and a half - I'm running the bar at https://emfcamp.org/ this week and it's taking all my time!)
Looks good to me, and will be useful to include.
The only thing blocking me merging it is the use of bare assert
in the tests — you should be using the various assertSomething
methods of unittest.TestCase
instead, eg. self.assertEqual(resp.value, 0)
instead of assert resp.value == 0
. See the unittest documentation for details.
Thanks for that @sde1000 , I'll update my tests and push some more changes in the next day or two :smile:
Hi @sde1000, I've updated the test code to use assertEqual
rather than bare assert
statements :smile:
Thank you!
This feature branch adds the necessary message handling to fakes.py to handle the various DALI level control messages, e.g. DAPC, RecallMaxLevel, etc. Such a feature was found to be helpful when testing out higher level code which uses this library, by enabling the use of fake DALI devices which correctly respond to certain messages.
Perhaps this isn’t the ideal place for such code to live, but since fakes.py already implemented the majority of the necessary features this seems to be the best fit within the existing structure.
Tests have been added to cover all of the additional code.