update test code

This commit is contained in:
Atsushi Sakai
2019-02-03 12:08:20 +09:00
parent aefa8990dd
commit d8cd25b1bd
3 changed files with 10 additions and 4 deletions

View File

@@ -145,7 +145,7 @@ def quinic_polynomials_planner(sx, sy, syaw, sv, sa, gx, gy, gyaw, gv, ga, max_a
print("find path!!")
break
if show_animation:
if show_animation: # pragma: no cover
for i, _ in enumerate(rx):
plt.cla()
plt.grid(True)
@@ -197,7 +197,7 @@ def main():
time, x, y, yaw, v, a, j = quinic_polynomials_planner(
sx, sy, syaw, sv, sa, gx, gy, gyaw, gv, ga, max_accel, max_jerk, dt)
if show_animation:
if show_animation: # pragma: no cover
plt.plot(x, y, "-r")
plt.subplots()

View File

@@ -2,8 +2,6 @@ from unittest import TestCase
from PathPlanning.AStar import a_star as m
print(__file__)
class Test(TestCase):

View File

@@ -22,3 +22,11 @@ class Test(TestCase):
assert(abs(px[-1] - end_x) <= 0.1)
assert(abs(py[-1] - end_y) <= 0.1)
assert(abs(pyaw[-1] - end_yaw) <= 0.1)
def test2(self):
dubins_path_planning.show_animation = False
dubins_path_planning.main()
def test3(self):
dubins_path_planning.show_animation = False
dubins_path_planning.test()