def test_infix_2(): postfix = i2p("5 +7") assert postfix.replace(" ", "") == "5 7 +".replace(" ", "")
def test_infix_1(self): postfix = i2p("4") self.assertEqual(postfix.replace(" ", ""), "4")
def test_infix_3(self): postfix = i2p("7*5") self.assertEqual(postfix.replace(" ", ""), "7 5 *".replace(" ", ""))
def test_infix_11(self): postfix = i2p("((8+3)*2)-7") self.assertEqual(postfix.replace(" ", ""), "8 3 + 2 * 7 -".replace(" ", ""))
def test_infix_13(self): postfix = i2p("((8*5+3)-7)-(5*3)") self.assertEqual(postfix.replace(" ", ""), "8 5 * 3 + 7 - 5 3 * -".replace(" ", ""))
def test_infix_7(self): postfix = i2p("8*(5+3)") self.assertEqual(postfix.replace(" ", ""), "8 5 3 + *".replace(" ", ""))
def test_infix_9(self): postfix = i2p("(8+3)*(5-6)") self.assertEqual(postfix.replace(" ", ""), "8 3 + 5 6 - *".replace(" ", ""))
def test_infix_8(): postfix = i2p("8+3*5-7") assert postfix.replace(" ", "") == "8 3 5 * + 7 -".replace(" ", "")
def test_infix_9(): postfix = i2p("(8+3)*(5-6)") assert postfix.replace(" ", "") == "8 3 + 5 6 - *".replace(" ", "")
def test_infix_6(): postfix = i2p("8*5+3") assert postfix.replace(" ", "") == "8 5 * 3 +".replace(" ", "")
def test_infix_7(): postfix = i2p("8*(5+3)") assert postfix.replace(" ", "") == "8 5 3 + *".replace(" ", "")
def test_infix_5(): postfix = i2p("5/5") assert postfix.replace(" ", "") == "5 5 /".replace(" ", "")
def test_infix_4(): postfix = i2p("(5-3)") assert postfix.replace(" ", "") == "5 3 -".replace(" ", "")
def test_infix_3(): postfix = i2p("7*5") assert postfix.replace(" ", "") == "7 5 *".replace(" ", "")
def test_infix_5(self): postfix = i2p("5/5") self.assertEqual(postfix.replace(" ", ""), "5 5 /".replace(" ", ""))
def test_infix_10(): postfix = i2p("((8+3)*(2-7))") assert postfix.replace(" ", "") == "8 3 + 2 7 - *".replace(" ", "")
def test_infix_6(self): postfix = i2p("8*5+3") self.assertEqual(postfix.replace(" ", ""), "8 5 * 3 +".replace(" ", ""))
def test_infix_11(): postfix = i2p("((8+3)*2)-7") assert postfix.replace(" ", "") == "8 3 + 2 * 7 -".replace(" ", "")
def test_infix_8(self): postfix = i2p("8+3*5-7") self.assertEqual(postfix.replace(" ", ""), "8 3 5 * + 7 -".replace(" ", ""))
def test_infix_12(): postfix = i2p("(8*5)+((3-2)-7*3)") assert postfix.replace(" ", "") == "8 5 * 3 2 - 7 3 * - +".replace(" ", "")
def test_infix_10(self): postfix = i2p("((8+3)*(2-7))") self.assertEqual(postfix.replace(" ", ""), "8 3 + 2 7 - *".replace(" ", ""))
def test_infix_13(): postfix = i2p("((8*5+3)-7)-(5*3)") assert postfix.replace(" ", "") == "8 5 * 3 + 7 - 5 3 * -".replace(" ", "")
def test_infix_12(self): postfix = i2p("(8*5)+((3-2)-7*3)") self.assertEqual(postfix.replace(" ", ""), "8 5 * 3 2 - 7 3 * - +".replace(" ", ""))
def test_infix_14(): postfix = i2p("7*9+7-5*6+3-4") assert postfix.replace(" ", "") == "7 9 * 7 + 5 6 * - 3 + 4 -".replace(" ", "")
def test_infix_14(self): postfix = i2p("7*9+7-5*6+3-4") self.assertEqual(postfix.replace(" ", ""), "7 9 * 7 + 5 6 * - 3 + 4 -".replace(" ", ""))
def test_infix_bad_expression(): with pytest.raises(SyntaxError): i2p("(8+3)*(5-6))")
def test_infix_2(self): postfix = i2p("5 +7") self.assertEqual(postfix.replace(" ", ""), "5 7 +".replace(" ", ""))
def test_infix_bad_param(): with pytest.raises(ValueError): i2p(None)
def test_infix_4(self): postfix = i2p("(5-3)") self.assertEqual(postfix.replace(" ", ""), "5 3 -".replace(" ", ""))
def test_infix_1(): postfix = i2p("4") assert postfix.replace(" ", "") == "4"