@@ -214,6 +214,35 @@ def test_get_processing_dependencies_multiple_lists(self):
214214
215215 assert result == ["dep1" , "dep2" , "dep3" , "dep4" , "dep5" ]
216216
217+ def test_get_processing_code_hash_with_none_dependencies (self ):
218+ """Test get_processing_code_hash does not raise TypeError when dependencies is None"""
219+ with tempfile .NamedTemporaryFile (mode = "w" , suffix = ".py" , delete = False ) as f :
220+ f .write ("print('hello')" )
221+ temp_file = f .name
222+
223+ try :
224+ # Should not raise TypeError
225+ result = get_processing_code_hash (code = temp_file , source_dir = None , dependencies = None )
226+
227+ assert result is not None
228+ assert len (result ) == 64
229+ finally :
230+ os .unlink (temp_file )
231+
232+ def test_get_processing_code_hash_with_none_dependencies_and_source_dir (self ):
233+ """Test get_processing_code_hash with source_dir and None dependencies"""
234+ with tempfile .TemporaryDirectory () as temp_dir :
235+ code_file = Path (temp_dir , "script.py" )
236+ code_file .write_text ("print('hello')" )
237+
238+ # Should not raise TypeError
239+ result = get_processing_code_hash (
240+ code = str (code_file ), source_dir = temp_dir , dependencies = None
241+ )
242+
243+ assert result is not None
244+ assert len (result ) == 64
245+
217246 def test_get_processing_code_hash_with_source_dir (self ):
218247 """Test get_processing_code_hash with source_dir"""
219248 with tempfile .TemporaryDirectory () as temp_dir :
@@ -264,6 +293,34 @@ def test_get_processing_code_hash_with_dependencies(self):
264293
265294 assert result is not None
266295
296+ def test_get_training_code_hash_with_none_dependencies_and_source_dir (self ):
297+ """Test get_training_code_hash with source_dir and None dependencies does not raise"""
298+ with tempfile .TemporaryDirectory () as temp_dir :
299+ entry_file = Path (temp_dir , "train.py" )
300+ entry_file .write_text ("print('training')" )
301+
302+ # Should not raise TypeError
303+ result = get_training_code_hash (
304+ entry_point = str (entry_file ), source_dir = temp_dir , dependencies = None
305+ )
306+
307+ assert result is not None
308+ assert len (result ) == 64
309+
310+ def test_get_training_code_hash_with_none_dependencies_and_entry_point (self ):
311+ """Test get_training_code_hash with entry_point only and None dependencies does not raise"""
312+ with tempfile .TemporaryDirectory () as temp_dir :
313+ entry_file = Path (temp_dir , "train.py" )
314+ entry_file .write_text ("print('training')" )
315+
316+ # Should not raise TypeError
317+ result = get_training_code_hash (
318+ entry_point = str (entry_file ), source_dir = None , dependencies = None
319+ )
320+
321+ assert result is not None
322+ assert len (result ) == 64
323+
267324 def test_get_training_code_hash_with_source_dir (self ):
268325 """Test get_training_code_hash with source_dir"""
269326 with tempfile .TemporaryDirectory () as temp_dir :
0 commit comments