Mercurial > hg > tvii
annotate tests/test_distance.py @ 84:0f3af15bb29a
add noise introduction function
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Sun, 17 Dec 2017 13:55:35 -0800 |
parents | c05ce6b7f941 |
children |
rev | line source |
---|---|
82 | 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() |