Record pathfinding context on flying disconnects
This commit is contained in:
1 parent
0b462f4a76
commit
d4eae5ee5f
5 files changed
+141
-2
No files matched your search
@@ -87,6 +87,20 @@ class DoorNavigationTests(unittest.TestCase):
|
||||
with self.assertRaises(AStarTimeout):
|
||||
finder.neighbors((0, 64, 0))
|
||||
|
||||
def test_pathfinder_records_completed_search_duration(self):
|
||||
g = Munch(chunks=FakeChunks({}), crawling=False,
|
||||
unopenable_doors=set())
|
||||
route = Pathfinder(g).astar((0, 64, 0), (0, 64, 0))
|
||||
|
||||
self.assertEqual(route, [(0, 64, 0)])
|
||||
self.assertEqual(g.pathfinding_active, {})
|
||||
self.assertEqual(len(g.pathfinding_history), 1)
|
||||
record = g.pathfinding_history[0]
|
||||
self.assertEqual(record['start'], (0, 64, 0))
|
||||
self.assertEqual(record['goal'], (0, 64, 0))
|
||||
self.assertEqual(record['status'], 'found')
|
||||
self.assertGreaterEqual(record['duration'], 0.0)
|
||||
|
||||
def test_path_prefix_detects_new_obstacles_and_missing_support(self):
|
||||
class TerrainChunks:
|
||||
def __init__(self):
|
||||
|
||||
Reference in new issue
Block a user