def top_test(self): ''' Test that the top 10 pixels are rescaled to 90. ''' top_test_result = clip(self.input_array, 90.0, 'top') top_test_result = N.sum(top_test_result == 90) error = 'test_clip.bottom_test got ' + str(top_test_result) + ' expected 10' assert top_test_result == 10, error
def bottom_test(self): ''' Test that the bottom 10 pixels are rescaled to 9. ''' bottom_test_result = clip(self.input_array, 9.0, 'bottom') bottom_test_result = N.sum(bottom_test_result == 9) error = 'test_clip.bottom_test got ' + str(bottom_test_result) + ' expected 10' assert bottom_test_result == 10, error