ElmoClient tests are revamped, ditching the fixtures and wrapping all the code directly into the tests themselves. This move not only boosts readability but also shaves off unnecessary layers. Now we're directly calling the constructor rather than dancing around with a fixture.
As for the client fixture, it's now crafted to mimic the genuine client's behavior. While the calls are mocked, every step of data retrieval and processing goes unhindered. This ensures other components aren't misled by mock returns, and the client fixture can act as an integration tests fixture.
Testing:
Tests are improved in readability but coverage stays the same.
Extra Notes (optional):
client fixture is not used, but we plan to migrate all AlarmDevice tests to it in a new PR.
Checklist
[x] Related issues and proposed changes are filled
[x] Tests are defining the correct and expected behavior
Related Issues
None.
Proposed Changes:
ElmoClient
tests are revamped, ditching the fixtures and wrapping all the code directly into the tests themselves. This move not only boosts readability but also shaves off unnecessary layers. Now we're directly calling the constructor rather than dancing around with a fixture.As for the client fixture, it's now crafted to mimic the genuine client's behavior. While the calls are mocked, every step of data retrieval and processing goes unhindered. This ensures other components aren't misled by mock returns, and the
client
fixture can act as an integration tests fixture.Testing:
Tests are improved in readability but coverage stays the same.
Extra Notes (optional):
client
fixture is not used, but we plan to migrate allAlarmDevice
tests to it in a new PR.Checklist