예제 #1
0
 def test_eval_reverse_polish_notation_string_simple_sum(self):
     val = "2 3 /"
     res = ValueEvaluator.eval_reverse_polish_notation(val)
     self.assertEqual(float(2) / 3, res)
예제 #2
0
 def test_eval_reverse_polish_notation_string_simple_sub(self):
     val = "2 3 -"
     res = ValueEvaluator.eval_reverse_polish_notation(val)
     self.assertEqual(-1, res)
예제 #3
0
 def test_eval_reverse_polish_notation_string_simple_multiply(self):
     val = "2 3 *"
     res = ValueEvaluator.eval_reverse_polish_notation(val)
     self.assertEqual(6, res)
예제 #4
0
 def test_eval_reverse_polish_notation_empty_string(self):
     res = ValueEvaluator.eval_reverse_polish_notation("")
     self.assertIsNone(res)
예제 #5
0
 def test_eval_reverse_polish_notation_string_none(self):
     res = ValueEvaluator.eval_reverse_polish_notation(None)
     self.assertIsNone(res)
예제 #6
0
 def test_eval_reverse_polish_notation_string_simple_sum(self):
     val = "2 3 /"
     res = ValueEvaluator.eval_reverse_polish_notation(val)
     self.assertEqual(float(2) / 3, res)
예제 #7
0
 def test_eval_reverse_polish_notation_string_simple_multiply(self):
     val = "2 3 *"
     res = ValueEvaluator.eval_reverse_polish_notation(val)
     self.assertEqual(6, res)
예제 #8
0
 def test_eval_reverse_polish_notation_string_simple_sub(self):
     val = "2 3 -"
     res = ValueEvaluator.eval_reverse_polish_notation(val)
     self.assertEqual(-1, res)
예제 #9
0
 def test_eval_reverse_polish_notation_string_none(self):
     res = ValueEvaluator.eval_reverse_polish_notation(None)
     self.assertIsNone(res)
예제 #10
0
 def test_eval_reverse_polish_notation_empty_string(self):
     res = ValueEvaluator.eval_reverse_polish_notation("")
     self.assertIsNone(res)