Skip to content

Commit

Permalink
reformatted test_converter
Browse files Browse the repository at this point in the history
  • Loading branch information
hamza.begic committed Jan 2, 2024
1 parent 8d97337 commit 62745d9
Showing 1 changed file with 24 additions and 33 deletions.
57 changes: 24 additions & 33 deletions tests/map_conversion/opendrive/conversion/test_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def test_lane_section_to_parametric_lanes(self):
center_lane.id = 0
center_lane.speed = 30
center_lane.road_mark = [RoadMark()]
center_lane.road_mark[0].type = 'solid solid'
center_lane.road_mark[0].type = "solid solid"

left_lane1 = Lane(road, section)
left_lane1.id = 1
Expand Down Expand Up @@ -160,35 +160,35 @@ def test_lane_section_to_parametric_lanes(self):
self.assertEquals(5.4, plane_groups_mark[2].parametric_lanes[0].line_marking.SOffset)

# check the inner line markings
self.assertEqual(plane_groups[0].inner_linemarking.type, 'solid solid') # id -1
self.assertEqual(plane_groups[1].inner_linemarking.type, 'unknown') # id -2
self.assertEqual(plane_groups[2].inner_linemarking.type, 'solid solid') # id 1
self.assertEqual(plane_groups[3].inner_linemarking.type, 'unknown') # id 2
self.assertEqual(plane_groups[4].inner_linemarking.type, 'unknown') # id 3
self.assertEqual(plane_groups[0].inner_linemarking.type, "solid solid") # id -1
self.assertEqual(plane_groups[1].inner_linemarking.type, "unknown") # id -2
self.assertEqual(plane_groups[2].inner_linemarking.type, "solid solid") # id 1
self.assertEqual(plane_groups[3].inner_linemarking.type, "unknown") # id 2
self.assertEqual(plane_groups[4].inner_linemarking.type, "unknown") # id 3

center_lane.road_mark[0].type = 'broken solid'
center_lane.road_mark[0].type = "broken solid"
plane_groups = OpenDriveConverter.lane_section_to_parametric_lanes(section, reference_border)
self.assertEqual(plane_groups[0].inner_linemarking.type, 'solid') # id -1
self.assertEqual(plane_groups[1].inner_linemarking.type, 'unknown') # id -2
self.assertEqual(plane_groups[2].inner_linemarking.type, 'broken') # id 1
self.assertEqual(plane_groups[3].inner_linemarking.type, 'unknown') # id 2
self.assertEqual(plane_groups[4].inner_linemarking.type, 'unknown') # id 3
self.assertEqual(plane_groups[0].inner_linemarking.type, "solid") # id -1
self.assertEqual(plane_groups[1].inner_linemarking.type, "unknown") # id -2
self.assertEqual(plane_groups[2].inner_linemarking.type, "broken") # id 1
self.assertEqual(plane_groups[3].inner_linemarking.type, "unknown") # id 2
self.assertEqual(plane_groups[4].inner_linemarking.type, "unknown") # id 3

center_lane.road_mark[0].type = 'solid broken'
center_lane.road_mark[0].type = "solid broken"
plane_groups = OpenDriveConverter.lane_section_to_parametric_lanes(section, reference_border)
self.assertEqual(plane_groups[0].inner_linemarking.type, 'broken') # id -1
self.assertEqual(plane_groups[1].inner_linemarking.type, 'unknown') # id -2
self.assertEqual(plane_groups[2].inner_linemarking.type, 'solid') # id 1
self.assertEqual(plane_groups[3].inner_linemarking.type, 'unknown') # id 2
self.assertEqual(plane_groups[4].inner_linemarking.type, 'unknown') # id 3
self.assertEqual(plane_groups[0].inner_linemarking.type, "broken") # id -1
self.assertEqual(plane_groups[1].inner_linemarking.type, "unknown") # id -2
self.assertEqual(plane_groups[2].inner_linemarking.type, "solid") # id 1
self.assertEqual(plane_groups[3].inner_linemarking.type, "unknown") # id 2
self.assertEqual(plane_groups[4].inner_linemarking.type, "unknown") # id 3

center_lane.road_mark[0].type = 'broken'
center_lane.road_mark[0].type = "broken"
plane_groups = OpenDriveConverter.lane_section_to_parametric_lanes(section, reference_border)
self.assertEqual(plane_groups[0].inner_linemarking.type, 'broken') # id -1
self.assertEqual(plane_groups[1].inner_linemarking.type, 'unknown') # id -2
self.assertEqual(plane_groups[2].inner_linemarking.type, 'broken') # id 1
self.assertEqual(plane_groups[3].inner_linemarking.type, 'unknown') # id 2
self.assertEqual(plane_groups[4].inner_linemarking.type, 'unknown') # id 3
self.assertEqual(plane_groups[0].inner_linemarking.type, "broken") # id -1
self.assertEqual(plane_groups[1].inner_linemarking.type, "unknown") # id -2
self.assertEqual(plane_groups[2].inner_linemarking.type, "broken") # id 1
self.assertEqual(plane_groups[3].inner_linemarking.type, "unknown") # id 2
self.assertEqual(plane_groups[4].inner_linemarking.type, "unknown") # id 3

def test_create_parametric_lane(self):
road = Road()
Expand Down Expand Up @@ -365,12 +365,3 @@ def test_determine_neighbors(self):
self.assertEqual(true_inner, inner_neighbour_id)
self.assertEqual(true_outer, outer_neighbour_id)
self.assertEqual(inner_neighbour_same_dir, True)









0 comments on commit 62745d9

Please sign in to comment.