Mercurial > hg > nsaunier > traffic-intelligence
comparison python/tests/utils.txt @ 31:c000f37c316d
moved tests to independent file, added chi2 computation
| author | Nicolas Saunier <nico@confins.net> |
|---|---|
| date | Sat, 13 Feb 2010 19:46:33 -0500 |
| parents | |
| children | 48e56179c39e |
comparison
equal
deleted
inserted
replaced
| 30:418b41056e6c | 31:c000f37c316d |
|---|---|
| 1 >>> from utils import * | |
| 2 >>> from moving import Point | |
| 3 | |
| 4 >>> computeChi2([],[]) | |
| 5 0.0 | |
| 6 >>> computeChi2(range(1,10),range(1,10)) | |
| 7 0.0 | |
| 8 >>> computeChi2(range(1,9),range(1,10)) | |
| 9 0.0 | |
| 10 | |
| 11 >>> segmentIntersection(Point(0,0),Point(1,1), Point(0,1), Point(1,2)) | |
| 12 >>> segmentIntersection(Point(0,1),Point(1,0), Point(0,2), Point(2,1)) | |
| 13 >>> segmentIntersection(Point(0,0),Point(2,0), Point(1,-1),Point(1,1)) | |
| 14 (1.000000,0.000000) | |
| 15 >>> segmentIntersection(Point(0,1),Point(2,0),Point(1,1),Point(1,2)) | |
| 16 | |
| 17 >>> f = openCheck('non_existant_file.txt') | |
| 18 File non_existant_file.txt could not be opened. | |
| 19 | |
| 20 >>> removeExtension('test-adfasdf.asdfa.txt') | |
| 21 'test-adfasdf.asdfa' | |
| 22 >>> removeExtension('test-adfasdf') | |
| 23 'test-adfasdf' |
