Skip to content

Commit

Permalink
Improve test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
yzhao062 authored and yuezhao@cs.toronto.edu committed Jun 3, 2018
1 parent 73d33b2 commit 5374e33
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ v<0.3.4>, <05/29/2018> -- Another urgent bug fix.
v<0.4.0>, <05/31/2018> -- Refactor all models to be sklearn compatible.
v<0.4.1>, <06/01/2018> -- Support Python 2.7, 3.4, 3.5 and 3.6.
v<0.4.2>, <06/01/2018> -- Fix Python 2.7 installation issue.
v<0.4.3>, <06/01/2018> -- Add more models and refactored examples.
v<0.4.3>, <06/02/2018> -- Add more models and refactored examples.
v<0.4.3>, <06/03/2018> -- Refactor HBOS and add new models.
5 changes: 5 additions & 0 deletions pyod/test/test_utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ class TestMetrics(unittest.TestCase):
def setUp(self):
self.y = [0, 0, 1, 1, 1, 0, 0, 0, 1, 0]
self.labels_ = [0.1, 0.2, 0.2, 0.8, 0.2, 0.5, 0.7, 0.9, 1, 0.3]
self.labels_short_ = [0.1, 0.2, 0.2, 0.8, 0.2, 0.5, 0.7, 0.9, 1]
self.manual_labels = [0, 0, 0, 1, 0, 0, 1, 1, 1, 0]
self.outlier_perc = 0.3

Expand All @@ -160,6 +161,10 @@ def test_get_label_n_equal_3(self):
assert_allclose(manual_labels,
get_label_n(self.y, self.labels_, n=3))

def test_inconsistent_length(self):
with assert_raises(ValueError):
get_label_n(self.y, self.labels_short_)

def tearDown(self):
pass

Expand Down

0 comments on commit 5374e33

Please sign in to comment.