Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
QuanyiLi committed Oct 27, 2023
1 parent 65306e0 commit 11fc4a9
Showing 1 changed file with 25 additions and 15 deletions.
40 changes: 25 additions & 15 deletions metadrive/tests/test_sensors/test_map_visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,30 @@
from metadrive.tests.vis_block.vis_block_base import TestBlock


def test_map_visualizer():
def _test_map_visualizer():
test = TestBlock(window_type="onscreen")
try:
initialize_asset_loader(test)

initialize_asset_loader(test)

global_network = NodeRoadNetwork()
b = FirstPGBlock(global_network, 3.0, 2, test.render, test.world, 1)
for i in range(1, 13):
tp = Merge if i % 3 == 0 else Split
b = tp(i, b.get_socket(0), global_network, i)
b.construct_block(test.render, test.world)
test.show_bounding_box(global_network)
test.taskMgr.step()
test.taskMgr.step()
test.taskMgr.step()
test.taskMgr.step()
test.taskMgr.step()
global_network = NodeRoadNetwork()
b = FirstPGBlock(global_network, 3.0, 2, test.render, test.world, 1)
for i in range(1, 13):
tp = Merge if i % 3 == 0 else Split
b = tp(i, b.get_socket(0), global_network, i)
b.construct_block(test.render, test.world)
test.show_bounding_box(global_network)
test.taskMgr.step()
test.taskMgr.step()
test.taskMgr.step()
test.taskMgr.step()
test.taskMgr.step()
finally:
import sys
if sys.version_info >= (3, 0):
import builtins
else:
import __builtin__ as builtins
if hasattr(builtins, "base"):
del builtins.base
test.taskMgr.destroy()
test.destroy()

0 comments on commit 11fc4a9

Please sign in to comment.