Debian Codegraph @

wxgeometrie/geolib/tests/test_courbes.py

raw symbols ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 # -*- coding: utf-8 -*-
2 import os, sys
3 TOPDIR = os.path.abspath(os.path.join(os.path.dirname(__file__),"../.."))
4 sys.path.insert(0, TOPDIR)
5
6 from wxgeometrie.geolib import (
7 Point, Fonction, Interpolation_polynomiale_par_morceaux,
8 Glisseur_courbe, Interpolation_lineaire, Courbe
9 )
10
11 import wx_unittest
12
13 class GeolibTest(wx_unittest.TestCase):
14
15 def test_Courbe(self):
16 f = Fonction('1/(x+3)')
17 c1 = Courbe(f)
18 self.assertIsInstance(c1, Courbe)
19 A = Point(0, 0)
20 B = Point(-1, 2)
21 C = Point(4, 3)
22 D = Point(-3, 1)
23 E = Point(4, 5)
24 c2 = Courbe(A, B, C, D, E)
25 try:
26 import scipy
27 self.assertIsInstance(c2, Interpolation_polynomiale_par_morceaux)
28 except ImportError:
29 self.assertIsInstance(c2, Interpolation_lineaire)
30