@@ -56,6 +56,21 @@ def test_parse_ruling_path_with_pythonenterprise(self) -> None:
5656 core .parse_ruling_path (path ),
5757 )
5858
59+ def test_parse_ruling_path_with_legacy_key (self ) -> None :
60+ path = "private/its-enterprise/ruling/src/test/resources/expected_ruling/scikit-learn/python-LineLength.json"
61+ self .assertEqual (
62+ ("scikit-learn" , "python" , "LineLength" ),
63+ core .parse_ruling_path (path ),
64+ )
65+
66+ def test_parse_rule_filename_rejects_empty_rule_key (self ) -> None :
67+ with self .assertRaises (ValueError ):
68+ core .parse_rule_filename ("python-.json" )
69+
70+ def test_parse_rule_filename_rejects_empty_repository (self ) -> None :
71+ with self .assertRaises (ValueError ):
72+ core .parse_rule_filename ("-S1066.json" )
73+
5974
6075class DiffLogicTest (unittest .TestCase ):
6176 def test_diff_ruling_jsons_added_issues (self ) -> None :
@@ -408,9 +423,7 @@ def test_resolve_source_path_for_project_rulings_falls_back_to_sources_child(sel
408423 io_impl .resolve_source_path ("project" , "S1716.py" ),
409424 )
410425
411- def test_resolve_source_path_for_project_rulings_falls_back_to_sources_internal (
412- self ,
413- ) -> None :
426+ def test_resolve_source_path_for_project_rulings_falls_back_to_sources_internal (self ) -> None :
414427 io_impl = io .GitHubActionIO ()
415428 with tempfile .TemporaryDirectory () as tmp_dir :
416429 sources_ruling = f"{ tmp_dir } /sources_ruling"
@@ -432,9 +445,7 @@ def test_resolve_source_path_for_project_rulings_falls_back_to_sources_internal(
432445 ):
433446 self .assertEqual (target , io_impl .resolve_source_path ("project" , "foo.py" ))
434447
435- def test_resolve_source_path_for_project_rulings_falls_back_to_namespace_child (
436- self ,
437- ) -> None :
448+ def test_resolve_source_path_for_project_rulings_falls_back_to_namespace_child (self ) -> None :
438449 io_impl = io .GitHubActionIO ()
439450 with tempfile .TemporaryDirectory () as tmp_dir :
440451 sources_ruling = f"{ tmp_dir } /sources_ruling"
0 commit comments