comparison DEPENDENCIES/mingw32/Python27/Lib/site-packages/numpy/polynomial/tests/test_printing.py @ 87:2a2c65a20a8b

Add Python libs and headers
author Chris Cannam
date Wed, 25 Feb 2015 14:05:22 +0000
parents
children
comparison
equal deleted inserted replaced
86:413a9d26189e 87:2a2c65a20a8b
1 from __future__ import division, absolute_import, print_function
2
3 import numpy.polynomial as poly
4 from numpy.testing import TestCase, run_module_suite, assert_
5
6
7 class test_str(TestCase):
8 def test_polynomial_str(self):
9 res = str(poly.Polynomial([0, 1]))
10 tgt = 'poly([0., 1.])'
11 assert_(res, tgt)
12
13 def test_chebyshev_str(self):
14 res = str(poly.Chebyshev([0, 1]))
15 tgt = 'leg([0., 1.])'
16 assert_(res, tgt)
17
18 def test_legendre_str(self):
19 res = str(poly.Legendre([0, 1]))
20 tgt = 'leg([0., 1.])'
21 assert_(res, tgt)
22
23 def test_hermite_str(self):
24 res = str(poly.Hermite([0, 1]))
25 tgt = 'herm([0., 1.])'
26 assert_(res, tgt)
27
28 def test_hermiteE_str(self):
29 res = str(poly.HermiteE([0, 1]))
30 tgt = 'herme([0., 1.])'
31 assert_(res, tgt)
32
33 def test_laguerre_str(self):
34 res = str(poly.Laguerre([0, 1]))
35 tgt = 'lag([0., 1.])'
36 assert_(res, tgt)
37
38
39 class test_repr(TestCase):
40 def test_polynomial_str(self):
41 res = repr(poly.Polynomial([0, 1]))
42 tgt = 'Polynomial([0., 1.])'
43 assert_(res, tgt)
44
45 def test_chebyshev_str(self):
46 res = repr(poly.Chebyshev([0, 1]))
47 tgt = 'Chebyshev([0., 1.], [-1., 1.], [-1., 1.])'
48 assert_(res, tgt)
49
50 def test_legendre_repr(self):
51 res = repr(poly.Legendre([0, 1]))
52 tgt = 'Legendre([0., 1.], [-1., 1.], [-1., 1.])'
53 assert_(res, tgt)
54
55 def test_hermite_repr(self):
56 res = repr(poly.Hermite([0, 1]))
57 tgt = 'Hermite([0., 1.], [-1., 1.], [-1., 1.])'
58 assert_(res, tgt)
59
60 def test_hermiteE_repr(self):
61 res = repr(poly.HermiteE([0, 1]))
62 tgt = 'HermiteE([0., 1.], [-1., 1.], [-1., 1.])'
63 assert_(res, tgt)
64
65 def test_laguerre_repr(self):
66 res = repr(poly.Laguerre([0, 1]))
67 tgt = 'Laguerre([0., 1.], [0., 1.], [0., 1.])'
68 assert_(res, tgt)
69
70
71 #
72
73 if __name__ == "__main__":
74 run_module_suite()