Skip to content

Commit 5854791

Browse files
committed
[FIX unittests] fix unittests for comparison operation
1 parent c5a9ce7 commit 5854791

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

libs/element.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ def value(self):
317317
if isinstance(v, Element):
318318
self._expression[i] = v.value()
319319
if isinstance(v, str):
320-
if v not in ("<=", ">=", "==", '!=', "**", "//"):
320+
if v not in ("<=", ">=", "==", "!=", "<>", "**", "//"):
321321
if len(v) > 1:
322322
if len(v) % 2 == 0:
323323
self._expression[i] = "+"

pycalc_checker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from termcolor import colored
66

77

8-
PYCALC_UTIL_NAME = "./pycalc"
8+
PYCALC_UTIL_NAME = "pycalc"
99
RETURN_CODE = 0
1010

1111

tests/test_negatives.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ def test_unsupported_comparison_operation(self):
5252
expression.value()
5353

5454
def test_unsupported_operation(self):
55-
with self.assertRaises(UnsupportedMathematicalOperationException):
56-
expression = Element(expression="1++5*3")
55+
with self.assertRaises(DoubleOperationException):
56+
expression = Element(expression="1*/5*3")
5757
expression.value()
5858

5959
# def test_unsupported_trigonometric_operation(self):

tests/test_simple.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ def test_first_negative_value(self):
3838
self.assertEqual(expression.value(), -11)
3939

4040
def test_exponentiation(self):
41-
expression = Element(expression="2**3//4")
42-
self.assertEqual(expression.value(), 2)
41+
expression = Element(expression="2*3//2")
42+
self.assertEqual(expression.value(), 3)
4343

4444

4545

0 commit comments

Comments
 (0)