@@ -73,19 +73,36 @@ def test_lookup_fails_invalid_ci_config_ref_uri(self, environment):
7373 ):
7474 gitlab .GitLabPublisher .lookup_by_claims (pretend .stub (), signed_claims )
7575
76- def test_lookup_succeeds_with_mixed_case_project_path (self , db_request ):
76+ @pytest .mark .parametrize (
77+ ("configured_namespace" , "configured_project" , "project_path" ),
78+ [
79+ (
80+ "Foo" ,
81+ "Bar" ,
82+ "foo/bar" ,
83+ ),
84+ (
85+ "foo" ,
86+ "bar" ,
87+ "Foo/Bar" ,
88+ ),
89+ ],
90+ )
91+ def test_lookup_succeeds_with_mixed_case_project_path (
92+ self , db_request , configured_namespace , configured_project , project_path
93+ ):
7794 # Test that we find a matching publisher when the project_path claims match
7895 # even if the case is different.
7996 stored_publisher = GitLabPublisherFactory (
80- namespace = "Foo" ,
81- project = "Bar" ,
97+ namespace = configured_namespace ,
98+ project = configured_project ,
8299 workflow_filepath = ".gitlab-ci.yml" ,
83100 environment = "" ,
84101 )
85102
86103 signed_claims = {
87- "project_path" : "foo/bar" , # different case than stored publisher
88- "ci_config_ref_uri" : ( "gitlab.com/foo/bar//.gitlab-ci.yml@refs/heads/main" ) ,
104+ "project_path" : project_path ,
105+ "ci_config_ref_uri" : "gitlab.com/foo/bar//.gitlab-ci.yml@refs/heads/main" ,
89106 "environment" : "some_environment" ,
90107 }
91108
0 commit comments