50daeb5d74
mostly spent time trying to figure out subprocess (which i though i already understood). I am concerned for what will happen with large datasets. next steps include: 1) design data struture 2) implement slurping of stdout into this structure 3) drink coke --HG-- rename : lib/smcqhull.py => lib/smcqdelaunay.py
28 lines
674 B
Python
Executable File
28 lines
674 B
Python
Executable File
#!/usr/bin/python
|
|
|
|
import unittest
|
|
|
|
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]]
|
|
|
|
|
|
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],
|
|
]
|
|
|
|
self.assertEqual(dt.indices, answer)
|
|
|
|
if __name__ == '__main__':
|
|
suite = unittest.TestLoader().loadTestsFromTestCase(TestSequenceFunctions)
|
|
unittest.TextTestRunner(verbosity=5).run(suite)
|