Mercurial > hg > tvii
comparison tests/test_distance.py @ 82:c05ce6b7f941
test distance calculations
| author | Jeff Hammel <k0scist@gmail.com> |
|---|---|
| date | Sun, 17 Dec 2017 13:45:44 -0800 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 81:990a27e125f2 | 82:c05ce6b7f941 |
|---|---|
| 1 #!/usr/bin/env python | |
| 2 | |
| 3 """ | |
| 4 test distance calculations | |
| 5 """ | |
| 6 | |
| 7 import os | |
| 8 import unittest | |
| 9 from tvii.distance import distance | |
| 10 | |
| 11 class TestDistance(unittest.TestCase): | |
| 12 | |
| 13 def test_triagle(self): | |
| 14 """a simple triangle""" | |
| 15 | |
| 16 x = [0., 3.] | |
| 17 y = [4., 0.] | |
| 18 | |
| 19 assert (distance(x, y) - 5.)**2 < 1e-6 | |
| 20 | |
| 21 if __name__ == '__main__': | |
| 22 unittest.main() |
