Closed lifeisafractal closed 5 years ago
Thanks for the PR. Before merging I'd like to get it locally and spend some time to be sure I understand what's happening. However, this week is tight, so this PR might hang a little while. I won't forget about it, for sure ;)
No problem about the time, I know how it is :). I've got another larger branch I'm working on now. I'm going to open an issue for that so we can have some design discussion before I bring it to completion.
Oh and one more last thing. Could you fix the conflicts in init_framework.py
?
It's a simple fix: I merged your first change with the extra functions, you just need to update the revamped mocking mechanism with the extra functions you added in the other PR ;)
I merged in upstream master and resolved the conflicts. This should be good to go.
One note, the work I'm doing for issue #18 will overhaul some of this further, but I think it's still worth while to get this incremental improvement in.
Thanks a lot! I'm merging 🙂
And I finally have some time to take a look at The big one 😁 Will do so now 😉
Some of my automatons make use of the
Hass.name
attribute, but this doesn't exist in the test framework as theHass.__init__()
function mocked without any behavior. This PR adds a new mock that will set thename
attribute.__init__
so we can get access to theself
instance object to setname
automation_fixture
will set the automation name to the name of the automation classI'm not super familiar with mocking in Python, so the spec'd solution I came to was more pragmatic than anything else. I'm very open to discussing other ways of accomplishing this, any maybe learning something new :).