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))
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]))
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"))
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))
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'))