@@ -614,10 +614,7 @@ def test_get_assets_metadata(mocker, tmp_path, assets_exist):
614
614
assert result == assets_data
615
615
else :
616
616
# No assets.json file exists
617
- mock_log = mocker .patch ("learning_resources.etl.utils.log" )
618
- result = utils .get_assets_metadata (str (olx_path ))
619
- assert result is None
620
- mock_log .warning .assert_called_once ()
617
+ assert utils .get_assets_metadata (str (olx_path )) is None
621
618
622
619
623
620
@pytest .mark .parametrize (
@@ -687,8 +684,6 @@ def test_get_video_metadata(mocker, tmp_path, video_dir_exists):
687
684
olx_path = tmp_path / "course"
688
685
olx_path .mkdir ()
689
686
690
- mock_log = mocker .patch ("learning_resources.etl.utils.log" )
691
-
692
687
if video_dir_exists :
693
688
video_dir = olx_path / "video"
694
689
video_dir .mkdir ()
@@ -720,9 +715,7 @@ def test_get_video_metadata(mocker, tmp_path, video_dir_exists):
720
715
assert call_args [1 ] == video_xml
721
716
else :
722
717
# No video directory
723
- result = utils .get_video_metadata (str (olx_path ), run )
724
- assert result == {}
725
- mock_log .warning .assert_called_once ()
718
+ assert utils .get_video_metadata (str (olx_path ), run ) == {}
726
719
727
720
728
721
@pytest .mark .parametrize (
@@ -798,7 +791,6 @@ def test_get_video_metadata(mocker, tmp_path, video_dir_exists):
798
791
],
799
792
)
800
793
def test_get_url_from_module_id ( # noqa: PLR0913
801
- mocker ,
802
794
settings ,
803
795
etl_source ,
804
796
module_id ,
@@ -836,9 +828,6 @@ def test_get_url_from_module_id( # noqa: PLR0913
836
828
else None
837
829
)
838
830
839
- # Mock log for warning cases
840
- mock_log = mocker .patch ("learning_resources.etl.utils.log" )
841
-
842
831
result = utils .get_url_from_module_id (
843
832
olx_path , module_id , run , assets_metadata , video_srt_metadata
844
833
)
@@ -847,9 +836,3 @@ def test_get_url_from_module_id( # noqa: PLR0913
847
836
assert result == expected_url_pattern
848
837
else :
849
838
assert result is None
850
- if not module_id :
851
- mock_log .warning .assert_any_call ("Module ID is empty" )
852
- elif module_id .endswith (".srt" ) and not has_video_meta :
853
- mock_log .debug .assert_any_call ("No video metadata for %s" , module_id )
854
- elif "unknown-format" in module_id or "invalid-uuid" in module_id :
855
- mock_log .warning .assert_any_call ("Unknown module ID format: %s" , module_id )
0 commit comments