Skip to content

Commit

Permalink
correct
Browse files Browse the repository at this point in the history
  • Loading branch information
gauravpatel67 committed Nov 19, 2024
1 parent 676df08 commit 0c317da
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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 = {
Expand All @@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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 = {
Expand All @@ -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."
assert result["body"]["error"] == "Both numbers are required"
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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 = {
Expand All @@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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 = {
Expand All @@ -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."
assert result["body"]["error"] == "Both numbers are required"

0 comments on commit 0c317da

Please sign in to comment.