diff --git a/src/lambda_functions/calculator_function/operations/add_operation.py b/src/lambda_functions/calculator_function/operations/add_operation.py index a86c5a1..d58924d 100644 --- a/src/lambda_functions/calculator_function/operations/add_operation.py +++ b/src/lambda_functions/calculator_function/operations/add_operation.py @@ -1,5 +1,5 @@ class AddOperation: def execute(self, first_number, second_number): if first_number is None or second_number is None: - raise ValueError("Both numbers are required for this operation.") + raise ValueError("Both numbers are required") return first_number + second_number diff --git a/src/lambda_functions/calculator_function/operations/divide_operation.py b/src/lambda_functions/calculator_function/operations/divide_operation.py index c8df41d..7f3e02b 100644 --- a/src/lambda_functions/calculator_function/operations/divide_operation.py +++ b/src/lambda_functions/calculator_function/operations/divide_operation.py @@ -1,7 +1,7 @@ class DivideOperation: def execute(self, first_number, second_number): if first_number is None or second_number is None: - raise ValueError("Both numbers are required for this operation.") + raise ValueError("Both numbers are required") if second_number == 0: raise ValueError("Division by zero is not allowed") return first_number / second_number diff --git a/src/lambda_functions/calculator_function/operations/multiply_operation.py b/src/lambda_functions/calculator_function/operations/multiply_operation.py index 7e19c32..c558520 100644 --- a/src/lambda_functions/calculator_function/operations/multiply_operation.py +++ b/src/lambda_functions/calculator_function/operations/multiply_operation.py @@ -1,5 +1,5 @@ class MultiplyOperation: def execute(self, first_number, second_number): if first_number is None or second_number is None: - raise ValueError("Both numbers are required for this operation.") + raise ValueError("Both numbers are required") return first_number * second_number diff --git a/src/lambda_functions/calculator_function/operations/subtract_operation.py b/src/lambda_functions/calculator_function/operations/subtract_operation.py index fd25e05..71f5066 100644 --- a/src/lambda_functions/calculator_function/operations/subtract_operation.py +++ b/src/lambda_functions/calculator_function/operations/subtract_operation.py @@ -1,5 +1,5 @@ class SubtractOperation: def execute(self, first_number, second_number): if first_number is None or second_number is None: - raise ValueError("Both numbers are required for this operation.") + raise ValueError("Both numbers are required") return first_number - second_number diff --git a/src/lambda_functions/calculator_function/test_cases/test_addition.py b/src/lambda_functions/calculator_function/test_cases/test_addition.py index 6b87588..47e9480 100644 --- a/src/lambda_functions/calculator_function/test_cases/test_addition.py +++ b/src/lambda_functions/calculator_function/test_cases/test_addition.py @@ -22,7 +22,7 @@ def test_addition_with_missing_second_number(): result = lambda_handler(event, None) assert result["statusCode"] == 400 - assert result["body"]["error"] == "Both numbers are required for this operation." + assert result["body"]["error"] == "Both numbers are required" def test_addition_with_missing_first_number(): event = { @@ -33,7 +33,7 @@ def test_addition_with_missing_first_number(): result = lambda_handler(event, None) assert result["statusCode"] == 400 - assert result["body"]["error"] == "Both numbers are required for this operation." + assert result["body"]["error"] == "Both numbers are required" def test_addition_with_missing_both_number(): event = { @@ -45,4 +45,4 @@ def test_addition_with_missing_both_number(): result = lambda_handler(event, None) assert result["statusCode"] == 400 - assert result["body"]["error"] == "Both numbers are required for this operation." + assert result["body"]["error"] == "Both numbers are required" diff --git a/src/lambda_functions/calculator_function/test_cases/test_division.py b/src/lambda_functions/calculator_function/test_cases/test_division.py index 715108e..730c638 100644 --- a/src/lambda_functions/calculator_function/test_cases/test_division.py +++ b/src/lambda_functions/calculator_function/test_cases/test_division.py @@ -36,7 +36,7 @@ def test_divide_with_missing_second_number(): result = lambda_handler(event, None) assert result["statusCode"] == 400 - assert result["body"]["error"] == "Both numbers are required for this operation." + assert result["body"]["error"] == "Both numbers are required" def test_divide_with_missing_first_number(): event = { @@ -47,7 +47,7 @@ def test_divide_with_missing_first_number(): result = lambda_handler(event, None) assert result["statusCode"] == 400 - assert result["body"]["error"] == "Both numbers are required for this operation." + assert result["body"]["error"] == "Both numbers are required" def test_divide_with_missing_both_number(): event = { @@ -59,4 +59,4 @@ def test_divide_with_missing_both_number(): result = lambda_handler(event, None) assert result["statusCode"] == 400 - assert result["body"]["error"] == "Both numbers are required for this operation." \ No newline at end of file + assert result["body"]["error"] == "Both numbers are required" \ No newline at end of file diff --git a/src/lambda_functions/calculator_function/test_cases/test_multiply.py b/src/lambda_functions/calculator_function/test_cases/test_multiply.py index 5db4444..ca5fa86 100644 --- a/src/lambda_functions/calculator_function/test_cases/test_multiply.py +++ b/src/lambda_functions/calculator_function/test_cases/test_multiply.py @@ -22,7 +22,7 @@ def test_multiply_with_missing_second_number(): result = lambda_handler(event, None) assert result["statusCode"] == 400 - assert result["body"]["error"] == "Both numbers are required for this operation." + assert result["body"]["error"] == "Both numbers are required" def test_multiply_with_missing_first_number(): event = { @@ -34,7 +34,7 @@ def test_multiply_with_missing_first_number(): result = lambda_handler(event, None) assert result["statusCode"] == 400 - assert result["body"]["error"] == "Both numbers are required for this operation." + assert result["body"]["error"] == "Both numbers are required" def test_multiply_with_missing_both_number(): event = { @@ -46,4 +46,4 @@ def test_multiply_with_missing_both_number(): result = lambda_handler(event, None) assert result["statusCode"] == 400 - assert result["body"]["error"] == "Both numbers are required for this operation." + assert result["body"]["error"] == "Both numbers are required" diff --git a/src/lambda_functions/calculator_function/test_cases/test_subtraction.py b/src/lambda_functions/calculator_function/test_cases/test_subtraction.py index d21d53e..7c1d42e 100644 --- a/src/lambda_functions/calculator_function/test_cases/test_subtraction.py +++ b/src/lambda_functions/calculator_function/test_cases/test_subtraction.py @@ -24,7 +24,7 @@ def test_subtraction_with_missing_second_number(): result = lambda_handler(event, None) assert result["statusCode"] == 400 - assert result["body"]["error"] == "Both numbers are required for this operation." + assert result["body"]["error"] == "Both numbers are required" def test_subtraction_with_missing_first_number(): event = { @@ -36,7 +36,7 @@ def test_subtraction_with_missing_first_number(): result = lambda_handler(event, None) assert result["statusCode"] == 400 - assert result["body"]["error"] == "Both numbers are required for this operation." + assert result["body"]["error"] == "Both numbers are required" def test_subtraction_with_missing_both_number(): event = { @@ -48,4 +48,4 @@ def test_subtraction_with_missing_both_number(): result = lambda_handler(event, None) assert result["statusCode"] == 400 - assert result["body"]["error"] == "Both numbers are required for this operation." \ No newline at end of file + assert result["body"]["error"] == "Both numbers are required" \ No newline at end of file