コード例 #1
0
 def test_equation_13(self):
     self.assertAlmostEqual(epf("8 5 * 3 + 7 - 5 3 * -"), 21.0)
コード例 #2
0
def test_equation_2():
    assert epf("5 7 +") == 12.0
コード例 #3
0
 def test_equation_9(self):
     self.assertAlmostEqual(epf("8 3 + 5 6 - *"), -11.0)
コード例 #4
0
 def test_equation_11(self):
     self.assertAlmostEqual(epf("8 3 + 2 * 7 -"), 15.0)
コード例 #5
0
 def test_equation_5(self):
     self.assertAlmostEqual(epf("5 5 /"), 1.0)
コード例 #6
0
 def test_equation_7(self):
     self.assertAlmostEqual(epf("8 5 3 + *"), 64.0)
コード例 #7
0
def test_equation_8():
    assert epf("8 3 5 * + 7 -") == 16.0
コード例 #8
0
 def test_equation_3(self):
     self.assertAlmostEqual(epf("5 7 *"), 35.0)
コード例 #9
0
def test_equation_6():
    assert epf("8 5 * 3 +") == 43.0
コード例 #10
0
def test_equation_7():
    assert epf("8 5 3 + *") == 64.0
コード例 #11
0
def test_equation_5():
    assert epf("5 5 /") == 1.0
コード例 #12
0
def test_equation_4():
    assert epf("5 3 -") == 2.0
コード例 #13
0
def test_equation_3():
    assert epf("5 7 *") == 35.0
コード例 #14
0
 def test_equation_1(self):
     self.assertAlmostEqual(epf("4"), 4.0)
コード例 #15
0
def test_equation_9():
    assert epf("8 3 + 5 6 - *") == -11.0
コード例 #16
0
 def test_equation_2(self):
     self.assertAlmostEqual(epf("5 7 +"), 12.0)
コード例 #17
0
def test_equation_10():
    assert epf("8 3 + 2 7 - *") == -55.0
コード例 #18
0
 def test_equation_4(self):
     self.assertAlmostEqual(epf("5 3 -"), 2.0)
コード例 #19
0
def test_equation_11():
    assert epf("8 3 + 2 * 7 -") == 15.0
コード例 #20
0
 def test_equation_6(self):
     self.assertAlmostEqual(epf("8 5 * 3 +"), 43.0)
コード例 #21
0
def test_equation_12():
    assert epf("8 5 * 3 2 - 7 3 * - +") == 20.0
コード例 #22
0
 def test_equation_8(self):
     self.assertAlmostEqual(epf("8 3 5 * + 7 -"), 16.0)
コード例 #23
0
def test_equation_13():
    assert epf("8 5 * 3 + 7 - 5 3 * -") == 21.0
コード例 #24
0
 def test_equation_10(self):
     self.assertAlmostEqual(epf("8 3 + 2 7 - *"), -55.0)
コード例 #25
0
def test_equation_14():
    assert epf(" 7 9 * 7 + 5 6 * - 3 + 4 -") == 39.0
コード例 #26
0
 def test_equation_12(self):
     self.assertAlmostEqual(epf("8 5 * 3 2 - 7 3 * - +"), 20.0)
コード例 #27
0
def test_bad_postfix():
    with pytest.raises(SyntaxError):
        epf(" 7 9 * 7 + 5 6 * - 3 + 4 -+")
    with pytest.raises(ValueError):
        epf(None)
コード例 #28
0
 def test_equation_14(self):
     self.assertAlmostEqual(epf(" 7 9 * 7 + 5 6 * - 3 + 4 -"), 39.0)
コード例 #29
0
def test_equation_1():
    assert epf("4") == 4.0