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)
def test_eval_reverse_polish_notation_string_simple_sub(self): val = "2 3 -" res = ValueEvaluator.eval_reverse_polish_notation(val) self.assertEqual(-1, res)
def test_eval_reverse_polish_notation_string_simple_multiply(self): val = "2 3 *" res = ValueEvaluator.eval_reverse_polish_notation(val) self.assertEqual(6, res)
def test_eval_reverse_polish_notation_empty_string(self): res = ValueEvaluator.eval_reverse_polish_notation("") self.assertIsNone(res)
def test_eval_reverse_polish_notation_string_none(self): res = ValueEvaluator.eval_reverse_polish_notation(None) self.assertIsNone(res)
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)
def test_eval_reverse_polish_notation_string_simple_multiply(self): val = "2 3 *" res = ValueEvaluator.eval_reverse_polish_notation(val) self.assertEqual(6, res)
def test_eval_reverse_polish_notation_string_simple_sub(self): val = "2 3 -" res = ValueEvaluator.eval_reverse_polish_notation(val) self.assertEqual(-1, res)
def test_eval_reverse_polish_notation_string_none(self): res = ValueEvaluator.eval_reverse_polish_notation(None) self.assertIsNone(res)
def test_eval_reverse_polish_notation_empty_string(self): res = ValueEvaluator.eval_reverse_polish_notation("") self.assertIsNone(res)