Files
behavior-tree/tests/test_navigation_catalog.py
T

11 lines
725 B
Python
Raw Normal View History

import unittest
class CatalogTests(unittest.TestCase):
def test_names_cells_and_version_are_exact(self):
from navigation_gateway.catalog import Catalog
site={'registry_version':3,'locations':{'stop':{'frame_id':'map','x':1,'y':2,'z':0,'qx':0,'qy':0,'qz':0,'qw':1}},'object_locations':{'water':'stop'},'cell_locations':{'s/FRONT/1/2':'stop'}}
c=Catalog(site)
self.assertEqual(c.resolve('OBJECT','water',3)['pose']['x'],1)
self.assertEqual(c.resolve('CELL','',3,shelf='s',side='FRONT',column='1',tier='2')['location_id'],'stop')
for args in [('OBJECT','unknown',3),('OBJECT','water',2),('LOCATION','water',3)]:
with self.assertRaises(ValueError):c.resolve(*args)