Skip to content

Commit bdebdb8

Browse files
committed
add tests
1 parent ebeb3d9 commit bdebdb8

2 files changed

Lines changed: 21 additions & 5 deletions

File tree

PathPlanning/RRTStarReedsShepp/rrt_star_reeds_shepp.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -300,11 +300,12 @@ def main():
300300
path = rrt.Planning(animation=show_animation)
301301

302302
# Draw final path
303-
rrt.DrawGraph()
304-
plt.plot([x for (x, y) in path], [y for (x, y) in path], '-r')
305-
plt.grid(True)
306-
plt.pause(0.001)
307-
plt.show()
303+
if show_animation:
304+
rrt.DrawGraph()
305+
plt.plot([x for (x, y) in path], [y for (x, y) in path], '-r')
306+
plt.grid(True)
307+
plt.pause(0.001)
308+
plt.show()
308309

309310

310311
if __name__ == '__main__':

tests/test_rrt_star_reeds_shepp.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from unittest import TestCase
2+
3+
import sys
4+
sys.path.append("./PathPlanning/RRTStarReedsShepp/")
5+
6+
from PathPlanning.RRTStarReedsShepp import rrt_star_reeds_shepp as m
7+
8+
print(__file__)
9+
10+
11+
class Test(TestCase):
12+
13+
def test1(self):
14+
m.show_animation = False
15+
m.main()

0 commit comments

Comments
 (0)