Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(simulator_compatibility_test): test codes adjustments #1439

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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