Skip to content

Commit

Permalink
Prepare v1.0.0-rc.1 release candidate
Browse files Browse the repository at this point in the history
Signed-off-by: hoangtungdinh <[email protected]>
  • Loading branch information
hoangtungdinh committed Oct 2, 2024
1 parent 465afee commit f03ce20
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 1 deletion.
5 changes: 4 additions & 1 deletion qc_openscenario/checks/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ def to_float(s):
return None


def get_root_without_default_namespace(path: str) -> etree._ElementTree:
def get_root_without_default_namespace(path: str) -> Union[None, etree._ElementTree]:
if not os.path.exists(path):
return None

with open(path, "rb") as raw_file:
xml_string = raw_file.read().decode()

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<OpenSCENARIO xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Schema/OpenSCENARIO.xsd">
<FileHeader author="ASAM e.V." date="2021-02-05T18:50:17" description="Simple Overtaker example" revMajor="1" revMinor="3" />
<ParameterDeclarations />
<CatalogLocations />
<RoadNetwork>
<LogicFile filepath="non_existing_file.xodr" />
</RoadNetwork>
<Entities>
<ScenarioObject name="Vehicle 1">
<Vehicle name="Vehicle 1" vehicleCategory="car">
<BoundingBox>
<Center x="1.3" y="0.0" z="0.75" />
<Dimensions width="1.8" length="4.5" height="1.5" />
</BoundingBox>
<Performance maxSpeed="200.0" maxDeceleration="30.0" maxAcceleration="200.0" />
<Axles>
<FrontAxle positionZ="0.4" trackWidth="1.68" positionX="2.98" maxSteering="0.5235987756" wheelDiameter="0.8" />
<RearAxle positionZ="0.4" trackWidth="1.68" positionX="0.0" maxSteering="0.5235987756" wheelDiameter="0.8" />
</Axles>
</Vehicle>
</ScenarioObject>
</Entities>
<Storyboard>
<Init>
<Actions>
<GlobalAction>
<InfrastructureAction>
<TrafficSignalAction>
<TrafficSignalStateAction name="12345" state="on;off;off" />
</TrafficSignalAction>
</InfrastructureAction>
</GlobalAction>
<Private entityRef="Vehicle 1">
<PrivateAction>
<TeleportAction>
<Position>
<WorldPosition x="0.0" y="0.0" />
</Position>
</TeleportAction>
</PrivateAction>
</Private>
</Actions>
</Init>
</Storyboard>
</OpenSCENARIO>
21 changes: 21 additions & 0 deletions tests/test_main_executor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import os
import pytest
import test_utils
from qc_baselib import Result, IssueSeverity, StatusType
from qc_openscenario.checks import basic_checker


def test_non_existing_road_network_file(
monkeypatch,
) -> None:
base_path = "tests/data/non_existing_road_network_file/"
target_file_name = f"non_existing_road_network_file.xosc"
target_file_path = os.path.join(base_path, target_file_name)

test_utils.create_test_config(target_file_path)

test_utils.launch_main(monkeypatch)

# Should have no exception
assert True
test_utils.cleanup_files()

0 comments on commit f03ce20

Please sign in to comment.