Skip to content

Commit

Permalink
Merge pull request #36 from sdevenes/fix/code_coverage
Browse files Browse the repository at this point in the history
add unit-test for analysis.py
  • Loading branch information
spanoamara authored Oct 7, 2020
2 parents 30ea2df + b379577 commit 1b13fc6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,19 @@ def test_get_confusion_matrix():
nose.tools.ok_((cm == ref).all(), msg="{} != {}".format(cm, ref))


def test_plot_confusion_matrix():
cm = np.array([[2, 0, 0], [0, 2, 1], [0, 1, 1]])
classes = np.array(["class1", "class2", "class3"])
save_path = base_path + "/output/confusion_matrix"
analysis.plot_confusion_matrix(
cm, classes, normalize=True, title="Confusion matrix", file_name=save_path
)
nose.tools.ok_(
os.path.isfile(save_path + ".html"),
msg="Confusion matrix graph not correctly generated",
)


def test_load():
datapath = base_path + "/inputs/test_set.csv"
data_len = 1225
Expand Down

0 comments on commit 1b13fc6

Please sign in to comment.