-
Notifications
You must be signed in to change notification settings - Fork 60
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
Added tests for map coordinates. #776
Added tests for map coordinates. #776
Conversation
I am fine with this precise checking if it passes. Otherwise, it this case, where they should be mostly rounded to the integer, assertAlmostEqual with the correct parameters would be preferred. What I do not like is that these tests only test two pixels in the first line or column (do not know which is which). The more interesting cases are the ones somewhere in the middle of the data. |
This test file is a 4x4 map so we are actually testing the middle pixels. |
Yes, you are testing middle pixels on the first row/column. Please test middle pixes on middle row/column. :) |
How about a test like this? All the coordinates... :) |
Your test was wrongly structured. I fixed this and simplified a bit. |
Your solution is much nicer! However, while confusing, I think the int() or round() difference is not important as what you are testing is code stability, not real things, right? In any case, thanks for the improvement. |
Tests should always be as real as you can make them. Ideally, you write them them knowing what the output is (should not fit inputs so that the output matches). And something being confusing is definitely a maintenance problem. |
No description provided.