@@ -164,15 +164,15 @@ def from_first_in(cls: Type["DSDLDefinition"], dsdl_path: Path, valid_dsdl_roots
164164 def __init__ (self , file_path : Path , root_namespace_path : Path ):
165165 """ """
166166 # Normalizing the path and reading the definition text
167- self ._file_path = Path (file_path )
167+ self ._file_path = Path (file_path ). resolve ()
168168 del file_path
169169
170170 if not self ._file_path .exists ():
171171 raise InvalidDefinitionError (
172172 "Attempt to construct ReadableDSDLFile object for file that doesn't exist." , self ._file_path
173173 )
174174
175- self ._root_namespace_path = Path (root_namespace_path )
175+ self ._root_namespace_path = Path (root_namespace_path ). resolve ()
176176 del root_namespace_path
177177 self ._text : str | None = None
178178
@@ -385,6 +385,16 @@ def _unittest_dsdl_definition_read_text(temp_dsdl_factory) -> None: # type: ign
385385 assert "@sealed" == target_definition .text
386386
387387
388+ def _unittest_dsdl_definition_issue_111 (temp_dsdl_factory ) -> None : # type: ignore
389+ target_root = Path ("root" , "ns" )
390+ target_file_path = Path (target_root / "Target.1.1.dsdl" )
391+ dsdl_file = temp_dsdl_factory .new_file (target_root / target_file_path , "@sealed" )
392+ actual_root = Path (str (dsdl_file .parent ) + "/.." )
393+
394+ target_definition = DSDLDefinition (actual_root / dsdl_file .parent / dsdl_file .name , actual_root )
395+ assert "@sealed" == target_definition .text
396+
397+
388398def _unittest_type_from_path_inference () -> None :
389399 from pytest import raises as expect_raises
390400
0 commit comments