def test_compute_polish_notation_float(self): s = '5.0 8 3 + /' self.assertIsInstance(compute_polish_notation(s), float)
def test_two_negative_element_in_expression(self): s = '-2 2 + -1 +' self.assertEqual(compute_polish_notation(s), -1)
def test_positive_element(self): s = '+2 2 *' self.assertEqual(compute_polish_notation(s), 4)
def test_first_negative_element(self): s = '-2 2 *' self.assertEqual(compute_polish_notation(s), -4)
def test_compute_polish_notation_as_integer(self): s = '5 8 3 + *' self.assertIsInstance(compute_polish_notation(s), int)