adapt test on __call__ for polynom
This commit is contained in:
parent
cd911a5513
commit
b3a07bf6e4
@ -33,20 +33,19 @@ class TestPolynom(unittest.TestCase):
|
|||||||
|
|
||||||
def test_eval_base(self):
|
def test_eval_base(self):
|
||||||
p = Polynom([1, 2])
|
p = Polynom([1, 2])
|
||||||
self.assertEqual(p(3).simplify(), 7)
|
self.assertEqual(p(3), 7)
|
||||||
|
|
||||||
def test_eval_const(self):
|
def test_eval_const(self):
|
||||||
p = Polynom([1])
|
p = Polynom([1])
|
||||||
self.assertEqual(p(3).simplify(), 1)
|
self.assertEqual(p(3), 1)
|
||||||
|
|
||||||
def test_eval_const_neg(self):
|
def test_eval_const_neg(self):
|
||||||
p = Polynom([-1])
|
p = Polynom([-1])
|
||||||
self.assertEqual(p(3).simplify(), -1)
|
self.assertEqual(p(3), -1)
|
||||||
|
|
||||||
def test_eval_poly(self):
|
def test_eval_poly(self):
|
||||||
p = Polynom([1, 2])
|
p = Polynom([1, 2])
|
||||||
hp1 = Expression("h+1")
|
self.assertEqual(p("h+1"), Polynom([3,2], "h"))
|
||||||
self.assertEqual(p(hp1).simplify(), Polynom([3,2], "h"))
|
|
||||||
|
|
||||||
#def test_print(self):
|
#def test_print(self):
|
||||||
# p = Polynom([1,2,3])
|
# p = Polynom([1,2,3])
|
||||||
|
Loading…
Reference in New Issue
Block a user