Skip to content

Commit

Permalink
Make tests easily runnable
Browse files Browse the repository at this point in the history
  • Loading branch information
gaverhae committed Mar 9, 2015
1 parent 3577a59 commit cc0b739
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions test_lof.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_LOF_normalize_instances():

def test_distance():
assert 1 == lof.distance_euclidean((1,1), (2,2))

def test_k_distance():
instances = ((1,1),(2,2),(3,3))
d = lof.k_distance(1,(2,2),instances)
Expand All @@ -27,10 +27,18 @@ def test_k_distance():
assert d == (0.20000000000000018, [(2,2)])
d = lof.k_distance(1,(2.5,2.5),instances)
assert d == (0.5, [(2,2),(3,3)])

def test_reachability_distance():
instances = ((1,1),(2,2),(3,3))
lof.reachability_distance(1, (1,1), (2,2), instances)

def test_outliers():
lof.outliers(1, instances)

if __name__ == "__main__":
print("Running tests, nothing more should appear if everything goes well.")
test_LOF_normalize_instances()
test_distance()
test_k_distance()
test_reachability_distance()
test_outliers()

0 comments on commit cc0b739

Please sign in to comment.