Package medite :: Package MediteAppli :: Package test :: Module test_utile
[hide private]
[frames] | no frames]

Source Code for Module medite.MediteAppli.test.test_utile

 1  # -*- coding: iso-8859-1 -*- 
 2  # Copyright 20003 - 2008: Julien Bourdaillet (julien.bourdaillet@lip6.fr), Jean-Gabriel Ganascia (jean-gabriel.ganascia@lip6.fr) 
 3  # This file is part of MEDITE. 
 4  # 
 5  #    MEDITE is free software; you can redistribute it and/or modify 
 6  #    it under the terms of the GNU General Public License as published by 
 7  #    the Free Software Foundation; either version 2 of the License, or 
 8  #    (at your option) any later version. 
 9  # 
10  #    MEDITE is distributed in the hope that it will be useful, 
11  #    but WITHOUT ANY WARRANTY; without even the implied warranty of 
12  #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
13  #    GNU General Public License for more details. 
14  # 
15  #    You should have received a copy of the GNU General Public License 
16  #    along with Foobar; if not, write to the Free Software 
17  #    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA 
18   
19  import unittest, contract 
20  import MediteAppli.utile 
21   
22 -class Test_Utile(unittest.TestCase):
23 - def setUp(self):
24 self.tool = MediteAppli.utile.Utile()
25
26 - def test_ajout_intervalle(self):
27 #L = [[0,5], [20,25], [30,40]] 28 #C = [10,15] 29 L = [[25, 30], [50, 56], [74, 88], [91, 105], [141, 151], [184, 188], [212, 227], [257, 284], [289, 290], [300, 321], [329, 333], [339, 356], [376, 382], [413, 446], [460, 466], [519, 525], [541, 549], [554, 564], [596, 597], [614, 632], [659, 666], [678, 680], [686, 699], [712, 714], [838, 862], [902, 908], [918, 937], [978, 980], [1005, 1007], [1015, 1020], [1025, 1030], [1039, 1070], [1178, 1203], [1217, 1221], [1236, 1243], [1254, 1266], [1286, 1291], [1294, 1296], [1326, 1331], [1333, 1336], [1360, 1372], [1442, 1444], [1457, 1466], [1516, 1519], [1563, 1578], [1583, 1586], [1618, 1648], [1653, 1681], [1686, 1732], [1740, 1759], [1773, 1826], [1832, 1844], [1860, 1868], [1871, 1874], [1880, 1891], [1903, 1918], [1923, 1926], [1931, 1935], [1953, 1970], [1974, 1977], [2010, 2015], [2021, 2028], [2034, 2036], [2042, 2050], [2055, 2060], [2075, 2087], [2149, 2156], [2164, 2165], [2177, 2178], [2183, 2186], [2264, 2265], [2279, 2294], [2299, 2312], [2322, 2332], [2353, 2357], [2381, 2383], [2399, 2408], [2413, 2414], [2439, 2459], [2463, 2469], [2479, 2495], [2499, 2501], [2504, 2508], [2527, 2531], [2561, 2564], [2580, 2611], [2618, 2624], [2629, 2638], [2646, 2649], [2657, 2668], [2673, 2687], [2728, 2764], [2772, 2776], [2800, 2810], [2821, 2845], [2877, 2881], [2884, 2887], [2907, 2919], [2926, 2934], [2941, 2955], [2995, 2997], [3013, 3017], [3034, 3037], [3053, 3055], [3068, 3079], [3087, 3093], [3119, 3127], [3131, 3140], [3145, 3152], [3175, 3180], [3185, 3186], [3189, 3193], [3194, 3198], [3200, 3213], [3221, 3231], [3246, 3249], [3256, 3261], [3281, 3284], [3325, 3327], [3356, 3363], [3412, 3420], [3443, 3452], [3462, 3465], [3477, 3489], [3521, 3522], [3541, 3550], [3554, 3565], [3585, 3597], [3666, 3673], [3682, 3721], [3747, 3761], [3800, 3808], [3820, 3822], [3839, 3855], [3874, 3878], [3888, 3935], [3941, 3952], [3958, 3972], [3975, 4016], [4027, 4037], [4065, 4074], [4120, 4125], [4153, 4163], [4206, 4207], [4218, 4225], [4265, 4269], [4285, 4288], [4304, 4308], [4314, 4317], [4327, 4352], [4386, 4388], [4446, 4459], [4485, 4491], [4531, 4533], [4593, 4598], [4603, 4621], [4653, 4663], [4735, 4742], [4764, 4786], [4795, 4809], [4842, 4849], [4855, 4873], [4899, 4914], [4929, 4938], [4945, 4957]] 30 LC = [[0, 18], [18, 25], [30, 37], [37, 50], [56, 68], [68, 71], [71, 74], [88, 91], [105, 110], [110, 114], [114, 120], [151, 157], [157, 164], [164, 167], [179, 184], [195, 202], [195, 196], [231, 235], [234, 239], [239, 245], [245, 248], [245, 248], [256, 257]] 31 for C in LC: 32 L = self.tool.ajout_intervalle(L, C) 33 print L
34 35
36 -def suite():
37 suite1 = unittest.TestSuite() 38 suite1.addTest(Test_Utile("test_ajout_intervalle")) 39 suite = unittest.TestSuite((suite1)) 40 return suite
41 42 if __name__ == '__main__': 43 unittest.TextTestRunner(verbosity=2).run(suite()) 44