コード例 #1
0
 def test_cropping_dimensions_with_box_arg_as_list(self):
     """Test if the image is cropped to the correct dimensions (box as list)"""
     cropped = crop_corners(self.image, "0, 0, 200, 200")
     self.assertTrue(cropped.size, (200, 200))
コード例 #2
0
 def test_cropping_disabled(self):
     """Test disabled cropping (indicated via negative first box value)"""
     self.assertImagesEqual(self.image,
                            crop_corners(self.image, [-1, 1, 1, 1]))
コード例 #3
0
 def test_cropping_with_invalid_box(self):
     """Test if an invalid box is ignored and the image is simply passed through"""
     self.assertImagesEqual(self.image, crop_corners(self.image, "NaN"))
コード例 #4
0
 def test_cropping_dimensions_with_box_arg_as_list(self):
     """Test if the image is cropped to the correct dimensions (box as list)"""
     cropped = crop_corners(self.image, '0, 0, 200, 200')
     self.assertTrue(cropped.size, (200, 200))
コード例 #5
0
 def test_cropping_disabled(self):
     """Test disabled cropping (indicated via negative first box value)"""
     self.assertImagesEqual(self.image, crop_corners(self.image, [-1, 1, 1, 1]))
コード例 #6
0
 def test_cropping_with_invalid_box(self):
     """Test if an invalid box is ignored and the image is simply passed through"""
     self.assertImagesEqual(self.image, crop_corners(self.image, 'NaN'))