2727
2828from rosidl_parser .definition import Array
2929from rosidl_parser .definition import BoundedSequence
30+ from rosidl_parser .definition import BoundedString
3031from rosidl_parser .definition import NamespacedType
31- from rosidl_parser .definition import String
3232from rosidl_parser .definition import UnboundedSequence
33+ from rosidl_parser .definition import UnboundedString
3334
3435
3536def test_strings ():
@@ -313,22 +314,22 @@ def test_slot_attributes():
313314 assert nested_slot_types [0 ].name == 'Primitives'
314315
315316 assert isinstance (nested_slot_types [1 ], Array )
316- assert isinstance (nested_slot_types [1 ].basetype , NamespacedType )
317- assert nested_slot_types [1 ].basetype .namespaces == \
317+ assert isinstance (nested_slot_types [1 ].value_type , NamespacedType )
318+ assert nested_slot_types [1 ].value_type .namespaces == \
318319 ['rosidl_generator_py' , 'msg' ]
319- assert nested_slot_types [1 ].basetype .name == 'Primitives'
320+ assert nested_slot_types [1 ].value_type .name == 'Primitives'
320321
321322 assert isinstance (nested_slot_types [2 ], BoundedSequence )
322- assert isinstance (nested_slot_types [2 ].basetype , NamespacedType )
323- assert nested_slot_types [2 ].basetype .namespaces == \
323+ assert isinstance (nested_slot_types [2 ].value_type , NamespacedType )
324+ assert nested_slot_types [2 ].value_type .namespaces == \
324325 ['rosidl_generator_py' , 'msg' ]
325- assert nested_slot_types [2 ].basetype .name == 'Primitives'
326+ assert nested_slot_types [2 ].value_type .name == 'Primitives'
326327
327328 assert isinstance (nested_slot_types [3 ], UnboundedSequence )
328- assert isinstance (nested_slot_types [3 ].basetype , NamespacedType )
329- assert nested_slot_types [3 ].basetype .namespaces == \
329+ assert isinstance (nested_slot_types [3 ].value_type , NamespacedType )
330+ assert nested_slot_types [3 ].value_type .namespaces == \
330331 ['rosidl_generator_py' , 'msg' ]
331- assert nested_slot_types [3 ].basetype .name == 'Primitives'
332+ assert nested_slot_types [3 ].value_type .name == 'Primitives'
332333
333334
334335def test_string_slot_attributes ():
@@ -340,24 +341,22 @@ def test_string_slot_attributes():
340341 assert len (string_slot_types ) == len (string_slots )
341342
342343 assert isinstance (string_slot_types [0 ], Array )
343- assert isinstance (string_slot_types [0 ].basetype , String )
344+ assert isinstance (string_slot_types [0 ].value_type , BoundedString )
344345 assert string_slot_types [0 ].size == 3
345- assert string_slot_types [0 ].basetype .maximum_size == 5
346+ assert string_slot_types [0 ].value_type .maximum_size == 5
346347
347348 assert isinstance (string_slot_types [1 ], BoundedSequence )
348- assert isinstance (string_slot_types [1 ].basetype , String )
349- assert string_slot_types [1 ].upper_bound == 10
350- assert string_slot_types [1 ].basetype .maximum_size == 5
349+ assert isinstance (string_slot_types [1 ].value_type , BoundedString )
350+ assert string_slot_types [1 ].maximum_size == 10
351+ assert string_slot_types [1 ].value_type .maximum_size == 5
351352
352353 assert isinstance (string_slot_types [2 ], UnboundedSequence )
353- assert isinstance (string_slot_types [2 ].basetype , String )
354- assert string_slot_types [2 ].basetype .maximum_size == 5
354+ assert isinstance (string_slot_types [2 ].value_type , BoundedString )
355+ assert string_slot_types [2 ].value_type .maximum_size == 5
355356
356357 assert isinstance (string_slot_types [3 ], UnboundedSequence )
357- assert isinstance (string_slot_types [3 ].basetype , String )
358- assert string_slot_types [3 ].basetype .maximum_size is None
358+ assert isinstance (string_slot_types [3 ].value_type , UnboundedString )
359359
360360 assert isinstance (string_slot_types [4 ], Array )
361- assert isinstance (string_slot_types [4 ].basetype , String )
361+ assert isinstance (string_slot_types [4 ].value_type , UnboundedString )
362362 assert string_slot_types [4 ].size == 3
363- assert string_slot_types [4 ].basetype .maximum_size is None
0 commit comments