-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Add draw_ellipse unit test #501
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
Conversation
Creates a surface containing an ellipse with equal width and height. It then checks for each border if it contains the colour of the ellipse, which it should. Resolves unit test task of #233
Very good! Thank you. There is little improvement you could make to avoid the display.set_mode, that I've made a note for. Could you please fit that one? |
test/draw_test.py
Outdated
self.fail() | ||
sizes = [(4, 4), (5, 4), (4, 5), (5, 5)] | ||
color = (1, 13, 24, 255) | ||
|
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
I removed the |
Nice one :) Thanks. Aha! I see what the problem is. If you click on the travis ci ones that fail you can see the error. The print statement needs to be removed. The tests shouldn't have print in them. |
Oh. I forgot to mention... People usually put a link to the issue in the description of the PR. So that people looking at the PR can more easily click on the issue. |
The unit test creates a surface of a certain width and height, then creates an ellipse with the same width and height on the surface. It then creates four lists containing the values of the top, left, right and bottom borders respectively. Finally it checks if each of these lists contains the colour of the ellipse, and if they don't then the test fails.
#233