smbinterp/test/qhull.test.py

28 lines
678 B
Python
Raw Normal View History

#!/usr/bin/env python
2009-12-27 09:48:27 -08:00
import unittest
2009-12-27 09:48:27 -08:00
class TestSequenceFunctions(unittest.TestCase):
def setUp(self):
self.l = [[-1, 1], [-1, 0], [-1, 1], [0, -1], [0, 0], [0, 1], [1, -1], [1, 0], [1, 1]]
2009-12-27 09:48:27 -08:00
def testQhull(self):
import delaunay
dt = delaunay.Triangulation(self.l)
answer = [
[4,1,3],
[1,5,0],
[5,1,4],
[7,3,6],
[7,4,3],
[7,5,4],
[5,7,8],
]
2009-12-27 09:48:27 -08:00
self.assertEqual(dt.indices, answer)
2009-12-27 09:48:27 -08:00
if __name__ == '__main__':
suite = unittest.TestLoader().loadTestsFromTestCase(TestSequenceFunctions)
unittest.TextTestRunner(verbosity=5).run(suite)