Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gibernas committed Dec 27, 2018
1 parent 8085961 commit e07e4b9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
13 changes: 5 additions & 8 deletions lib-visualodo/src/duckietown_visualodo_tests/test-utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import numpy as np
from comptests import comptest, run_module_tests, comptest_fails
from duckietown_visualodo.algo.utils import second_largest
import duckietown_visualodo



Expand All @@ -11,15 +12,11 @@ def check_util():
a = [1,2,3,4]
assert(second_largest(a)==3)

@comptest
def test_sum2():
np.testing.assert_almost_equal(0.1 + 0.2, 0.3)


# use comptest_fails for a test that is supposed to fail
@comptest_fails
def test_supposed_to_fail():
raise Exception()
@comptest
def check_is_rotation_matrix():
M = np.array([[1,0,0],[0,1,0],[0,0,1]])
assert is_rotation_matrix(M)


if __name__ == '__main__':
Expand Down
7 changes: 1 addition & 6 deletions lib-visualodo/src/duckietown_visualodo_tests/test1.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# coding=utf-8
import numpy as np
from comptests import comptest, run_module_tests, comptest_fails
from duckietown_visualodo.algo.utils import second_largest


@comptest
Expand All @@ -14,10 +13,6 @@ def test_sum2():
def test_supposed_to_fail():
raise Exception()

@comptest
def check_util():
a = [1,2,3,4]
assert(second_largest(a)==3)


if __name__ == '__main__':
run_module_tests()

0 comments on commit e07e4b9

Please sign in to comment.