-
Notifications
You must be signed in to change notification settings - Fork 659
Add tests for player #1198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tests for player #1198
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1198 +/- ##
===========================================
+ Coverage 65.65% 65.83% +0.17%
===========================================
Files 86 86
Lines 8846 8859 +13
===========================================
+ Hits 5808 5832 +24
+ Misses 3038 3027 -11 |
|
I think this is ready for review and merge now |
zariiii9003
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello Peter, thank you for your contribution and sorry for the late reply! Tests are always welcome.
I think it makes sense to check the call arguments of the mock. Otherwise this looks good to me, just some minor cosmetic issues.
Co-authored-by: zariiii9003 <52598363+zariiii9003@users.noreply.github.com>
|
Thank you for your review. i changed the code now accordingly |
|
Unfortunatelly the compare operator was not implemented for messages. I implemented this now. But do you want this to be added with this pr? |
There is a |
I knew about the |
I wonder how i did not notice that, sorry. Nevertheless, there was a discussion in #413 and We could this instead: self.assertTrue(self.mock_virtual_bus.send.mock_calls[0].args[0].equals(msg1))
self.assertTrue(self.mock_virtual_bus.send.mock_calls[1].args[0].equals(msg2))It's ugly but it does the job. |
a243016 to
5c6480b
Compare
Ok, i implemented it this way now. I used the created message object for the |
|
Unfortunately some tests fail now. i will try to fix this |
It looks like the problem is that the args property was introduced with python3.8. So i only compare this in higher versions now. I think this is ok as the behaviour should not change with python version |
felixdivo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a really nice PR! Thanks for tackling this "technical debt" and making sure the code actually works in unit tests! And most importantly, these serve as great regression tests for future changes.
Do you agree that this resolves #584?
Co-authored-by: Felix Divo <4403130+felixdivo@users.noreply.github.com>
This implements test for the issue #584. It is not finished yet but i will continue working on this