Skip to content

Commit

Permalink
feat(simulator_compatibility_test): test codes adjustments (autowaref…
Browse files Browse the repository at this point in the history
…oundation#1439)

* [refactoring] simulator compatibility test

1. organizing test structure
2. renaming modules

Signed-off-by: SoohyeokPark-MORAI <shpark.morai@gmail.com>

* Revert "[refactoring] simulator compatibility test"

This reverts commit e79f976.

Signed-off-by: SoohyeokPark-MORAI <shpark.morai@gmail.com>

* test codes adjustments

Signed-off-by: SoohyeokPark-MORAI <shpark.morai@gmail.com>
  • Loading branch information
SoohyeokPark-MORAI authored and yukke42 committed Oct 14, 2022
1 parent 7a57db2 commit 17aae1c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import pytest
from simulator_compatibility_test.publishers.control_mode_command import (
ControlModeCommand_Constants,
)
Expand All @@ -6,6 +7,7 @@


class Test01ControlModeAndReportMorai(Test01ControlModeAndReportBase):
@pytest.mark.skip(reason="manual mode is not required for now")
def test_1_manual_mode(self, setup_method):
self.set_control_mode(ControlModeCommand_Constants.MANUAL)
result = self.get_control_mode_report()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,9 @@ class Test03LongitudinalCommandAndReportMorai(Test03LongitudinalCommandAndReport
def setup_class(cls) -> None:
super().setup_class()

def test_1_speed_control(self, setup_and_teardown):
target_value = 100.0
self.set_speed(target_value)
time.sleep(3)
def test_1_longitudinal_control(self, setup_and_teardown):
self.set_speed(5.0)
self.set_acceleration(1.0)
time.sleep(10)
current_speed = self.get_velocity_report()
assert current_speed.longitudinal_velocity > 10.0

def test_2_acceleration_control(self, setup_and_teardown):
target_value = 100.0
self.set_acceleration(target_value)
time.sleep(3)
current_speed = self.get_velocity_report()
assert current_speed.longitudinal_velocity > 10.0
assert current_speed.longitudinal_velocity > 5.0
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import pytest
from simulator_compatibility_test.publishers.control_mode_command import (
ControlModeCommand_Constants,
)
Expand All @@ -6,6 +7,7 @@


class Test01ControlModeAndReportSim(Test01ControlModeAndReportBase):
@pytest.mark.skip(reason="manual mode is not required for now")
def test_1_manual_mode(self, setup_method):
self.set_control_mode(ControlModeCommand_Constants.MANUAL)
result = self.get_control_mode_report()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,9 @@ class Test03LongitudinalCommandAndReportSim(Test03LongitudinalCommandAndReportBa
def setup_class(cls) -> None:
super().setup_class()

def test_1_speed_control(self, setup_and_teardown):
target_value = 100.0
self.set_speed(target_value)
time.sleep(3)
def test_1_longitudinal_control(self, setup_and_teardown):
self.set_speed(5.0)
self.set_acceleration(1.0)
time.sleep(10)
current_speed = self.get_velocity_report()
assert current_speed.longitudinal_velocity > 10.0

def test_2_acceleration_control(self, setup_and_teardown):
target_value = 100.0
self.set_acceleration(target_value)
time.sleep(3)
current_speed = self.get_velocity_report()
assert current_speed.longitudinal_velocity > 10.0
assert current_speed.longitudinal_velocity > 5.0

0 comments on commit 17aae1c

Please sign in to comment.