def test_delete_all_lines_max_line_gap_negative(self): with pytest.raises(ValueError) as exc: ld.delete_all_lines(self.test_image, max_line_gap=-10) assert exc.value.message == "Max_line_gap must be greater than 0."
def test_delete_all_lines_color_error(self): with pytest.raises(ValueError) as exc: ld.delete_all_lines(self.test_image, color=(260, 0, 0)) assert exc.value.message == "Color value must be: (0-255, 0-255, 0-255)."
def test_delete_all_lines_min_line_length_negative(self): with pytest.raises(ValueError) as exc: ld.delete_all_lines(self.test_image, min_line_length=-10) assert exc.value.message == "Min_line_length must be greater than 0."
def test_delete_all_lines_threshold_negative(self): with pytest.raises(ValueError) as exc: ld.delete_all_lines(self.test_image, threshold=-1) assert exc.value.message == "Threshold value must be greater than 0."
def test_delete_all_lines_width_negative(self): with pytest.raises(ValueError) as exc: ld.delete_all_lines(self.test_image, width=-10) assert exc.value.message == "Width value must be greater than 0."
def test_delete_all_lines_min_val_over_max_val(self): with pytest.raises(ValueError) as exc: ld.delete_all_lines(self.test_image, min_val=200, max_val=100) assert exc.value.message == "Min_val value must be lesser than max_val."
def test_delete_all_lines_rho_negative(self): with pytest.raises(ValueError) as exc: ld.delete_all_lines(self.test_image, rho=-1) assert exc.value.message == "Rho value must be greater than 0."
def test_delete_all_lines_max_val_overflow_error(self): with pytest.raises(ValueError) as exc: ld.delete_all_lines(self.test_image, min_val=100, max_val=260) assert exc.value.message == "Max_val value must be between 0 and 255."
def test_delete_all_lines_min_val_negative_error(self): with pytest.raises(ValueError) as exc: ld.delete_all_lines(self.test_image, min_val=-200) assert exc.value.message == "Min_val value must be between 0 and 255."
def test_delete_all_lines_file_not_found(self): with pytest.raises(IOError) as exc: ld.delete_all_lines("fakePath") assert exc.value.message == "Input file not found."
def test_delete_all_lines_file_none(self): with pytest.raises(ValueError) as exc: ld.delete_all_lines(None) assert exc.value.message == "Input_file must be different than '' " \ "or None."
def test_delete_all_lines_good(self): assert isinstance(ld.delete_all_lines(self.test_image), np.ndarray)