andrewshilliday / garage-door-controller

Software to monitor and control garage doors via a raspberry pi
MIT License
327 stars 132 forks source link

Tested controller #22

Closed jfdupuis closed 5 years ago

jfdupuis commented 8 years ago

Hi,

I came across your project and found that it would great for my garage. I prefer to use tested code, so I've added test support for this project. Some refactoring of the code was done to improve readability and testability. No new functionality was added. A few bugs were found through testing.

Regards,

JF

andrewshilliday commented 7 years ago

This is great. I'd be happy to merge it in, but I think I merged some of the other changes in first and they are in conflict with your pull request. Would you mind resolving the conflicts and submitting a new pull request?

jfdupuis commented 7 years ago

Conflicts should be solved now.

andrewshilliday commented 7 years ago

Few things: First of all, the pull request still shows up as conflicted. Admittedly I'm not all that savvy with Git (more experienced with SVN) so I'm not sure how to go about resolving it. If you can fix the pull request so that it can be cleanly merged, I can integrate it.

Second, can you explain a little bit about how you refactored the code? It looks like you split the controller.py file into two separate files (which makes sense), but is there any special build/test process that we would need to follow?

jfdupuis commented 7 years ago

The conflict were solved, but you merged more pull request. I'll resolve the new conflicts.

A lot of the refactor was done to allow testing of the controller and enable some mocking of key functions. You can run the test with the following command: $ python3 -u -m unittest test/test_garage_controller.py

jfdupuis commented 7 years ago

Conflicts are solved. Since this is a big change, I suggest that you avoid doing minor commits until this get in. Otherwise, conflicts with keep happening.

andrewshilliday commented 7 years ago

Thanks! I'll take a look over the code and merge it in as soon as I get a chance.