1010import pytest
1111import yaml
1212
13- from scripts . ci .release_intent import (
13+ from ci .release_intent import (
1414 ReleaseIntentError ,
1515 get_defaults ,
1616 get_workflow_dispatch_inputs ,
@@ -524,14 +524,14 @@ def test_main_success_with_defaults(self) -> None:
524524 mock_schema = {"type" : "object" }
525525 mock_intent = None # No intent file
526526
527- with patch ("scripts. ci.release_intent.load_schema" , return_value = mock_schema ):
528- with patch ("scripts. ci.release_intent.load_intent_file" , return_value = mock_intent ):
527+ with patch ("ci.release_intent.load_schema" , return_value = mock_schema ):
528+ with patch ("ci.release_intent.load_intent_file" , return_value = mock_intent ):
529529 with patch (
530- "scripts. ci.release_intent.get_workflow_dispatch_inputs" ,
530+ "ci.release_intent.get_workflow_dispatch_inputs" ,
531531 return_value = {"level" : "" , "python" : "" , "docker" : "" , "docs" : "" , "notes" : "" },
532532 ):
533- with patch ("scripts. ci.release_intent.validate_intent" ):
534- with patch ("scripts. ci.release_intent.write_github_outputs" ):
533+ with patch ("ci.release_intent.validate_intent" ):
534+ with patch ("ci.release_intent.write_github_outputs" ):
535535 with patch ("builtins.print" ) as mock_print :
536536 result = main ()
537537
@@ -548,14 +548,14 @@ def test_main_success_with_file_data(self) -> None:
548548 mock_schema = {"type" : "object" }
549549 mock_intent = {"release" : False , "level" : "major" , "notes" : "Custom notes" }
550550
551- with patch ("scripts. ci.release_intent.load_schema" , return_value = mock_schema ):
552- with patch ("scripts. ci.release_intent.load_intent_file" , return_value = mock_intent ):
551+ with patch ("ci.release_intent.load_schema" , return_value = mock_schema ):
552+ with patch ("ci.release_intent.load_intent_file" , return_value = mock_intent ):
553553 with patch (
554- "scripts. ci.release_intent.get_workflow_dispatch_inputs" ,
554+ "ci.release_intent.get_workflow_dispatch_inputs" ,
555555 return_value = {"level" : "" , "python" : "" , "docker" : "" , "docs" : "" , "notes" : "" },
556556 ):
557- with patch ("scripts. ci.release_intent.validate_intent" ):
558- with patch ("scripts. ci.release_intent.write_github_outputs" ):
557+ with patch ("ci.release_intent.validate_intent" ):
558+ with patch ("ci.release_intent.write_github_outputs" ):
559559 with patch ("builtins.print" ) as mock_print :
560560 result = main ()
561561
@@ -568,7 +568,7 @@ def test_main_success_with_file_data(self) -> None:
568568
569569 def test_main_release_intent_error (self ) -> None :
570570 """Test main function with ReleaseIntentError."""
571- with patch ("scripts. ci.release_intent.load_schema" , side_effect = ReleaseIntentError ("Schema error" )):
571+ with patch ("ci.release_intent.load_schema" , side_effect = ReleaseIntentError ("Schema error" )):
572572 with patch ("builtins.print" ) as mock_print :
573573 result = main ()
574574
@@ -577,7 +577,7 @@ def test_main_release_intent_error(self) -> None:
577577
578578 def test_main_unexpected_error (self ) -> None :
579579 """Test main function with unexpected error."""
580- with patch ("scripts. ci.release_intent.load_schema" , side_effect = RuntimeError ("Unexpected error" )):
580+ with patch ("ci.release_intent.load_schema" , side_effect = RuntimeError ("Unexpected error" )):
581581 with patch ("builtins.print" ) as mock_print :
582582 result = main ()
583583
@@ -596,11 +596,11 @@ def test_main_success_with_workflow_inputs(self) -> None:
596596 "notes" : "Workflow notes" ,
597597 }
598598
599- with patch ("scripts. ci.release_intent.load_schema" , return_value = mock_schema ):
600- with patch ("scripts. ci.release_intent.load_intent_file" , return_value = mock_intent ):
601- with patch ("scripts. ci.release_intent.get_workflow_dispatch_inputs" , return_value = mock_workflow_inputs ):
602- with patch ("scripts. ci.release_intent.validate_intent" ):
603- with patch ("scripts. ci.release_intent.write_github_outputs" ):
599+ with patch ("ci.release_intent.load_schema" , return_value = mock_schema ):
600+ with patch ("ci.release_intent.load_intent_file" , return_value = mock_intent ):
601+ with patch ("ci.release_intent.get_workflow_dispatch_inputs" , return_value = mock_workflow_inputs ):
602+ with patch ("ci.release_intent.validate_intent" ):
603+ with patch ("ci.release_intent.write_github_outputs" ):
604604 with patch ("builtins.print" ) as mock_print :
605605 result = main ()
606606
@@ -618,14 +618,14 @@ def test_main_validation_error(self) -> None:
618618 mock_schema = {"type" : "object" }
619619 mock_intent = {"release" : "invalid" } # Invalid data
620620
621- with patch ("scripts. ci.release_intent.load_schema" , return_value = mock_schema ):
622- with patch ("scripts. ci.release_intent.load_intent_file" , return_value = mock_intent ):
621+ with patch ("ci.release_intent.load_schema" , return_value = mock_schema ):
622+ with patch ("ci.release_intent.load_intent_file" , return_value = mock_intent ):
623623 with patch (
624- "scripts. ci.release_intent.get_workflow_dispatch_inputs" ,
624+ "ci.release_intent.get_workflow_dispatch_inputs" ,
625625 return_value = {"level" : "" , "python" : "" , "docker" : "" , "docs" : "" , "notes" : "" },
626626 ):
627627 with patch (
628- "scripts. ci.release_intent.validate_intent" , side_effect = ReleaseIntentError ("Validation failed" )
628+ "ci.release_intent.validate_intent" , side_effect = ReleaseIntentError ("Validation failed" )
629629 ):
630630 with patch ("builtins.print" ) as mock_print :
631631 result = main ()
0 commit comments