77from reqstool_python_decorators .decorators .decorators import Requirements
88
99from reqstool .common .exceptions import CircularImplementationError , CircularImportError , MissingRequirementsFileError
10- from reqstool .common .utils import TempDirectoryUtil , Utils
10+ from reqstool .common .utils import TempDirectoryManager , Utils
1111from reqstool .common .validators .semantic_validator import SemanticValidator
1212from reqstool .location_resolver .location_resolver import LocationResolver
1313from reqstool .locations .location import LocationInterface
@@ -34,6 +34,7 @@ def __init__(
3434 initial_location : LocationInterface ,
3535 semantic_validator : SemanticValidator ,
3636 database : Optional [RequirementsDatabase ] = None ,
37+ tmpdir_manager : Optional [TempDirectoryManager ] = None ,
3738 ):
3839 self .__level : int = 0
3940 self .__initial_location_handler : LocationResolver = LocationResolver (
@@ -43,11 +44,12 @@ def __init__(
4344 self ._parsing_order : List [str ] = []
4445 self ._parsing_graph : Dict [str , List [Tuple [str , str ]]] = defaultdict (list )
4546 self ._database = database
47+ self ._tmpdir_manager = tmpdir_manager if tmpdir_manager is not None else TempDirectoryManager ()
4648 self .combined_raw_datasets = self .__generate ()
4749
4850 def __generate (self ) -> CombinedRawDataset :
4951 # handle initial source
50- logging .debug (f"Using temporary path: { TempDirectoryUtil .get_path ()} \n " )
52+ logging .debug (f"Using temporary path: { self . _tmpdir_manager .get_path ()} \n " )
5153
5254 raw_datasets : Dict [str , RawDataset ] = {}
5355
@@ -235,7 +237,7 @@ def __parse_source(self, current_location_handler: LocationResolver) -> RawDatas
235237 mvrs_data = None
236238 automated_tests = None
237239
238- tmp_path = TempDirectoryUtil .get_suffix_path ("can_we_use_urn_here" ).absolute ()
240+ tmp_path = self . _tmpdir_manager .get_suffix_path ("can_we_use_urn_here" ).absolute ()
239241
240242 actual_tmp_path = current_location_handler .make_available_on_localdisk (dst_path = tmp_path )
241243
0 commit comments