>I don't really understand any of these tests... Could you comment on why this should be the case? I don't see either how this is checking the rotation itself.

@dpshelio : The tests in line no 194 and 195 are derived from the fact that rotating a map by non-integer multiple of pi/2 cuts of the corners of the map or in other words, the values of those rectangular pixels is pushed back to zero, which reduces the mean and increases standard deviation.

>Would not make more sense to rotate the image 90 degrees and check whether the mean and std are the same?

For 90 degrees and 180 degrees, I have included the tests at line 198 and line 199. I hope my answer clears the ambiguity.