@@ -59,6 +59,32 @@ def test_get_single_match(self, mock_get_trees_for_org: Any) -> None:
5959 assert response .status_code == 200 , response .content
6060 assert response .data == expected_matches
6161
62+ @patch ("sentry.integrations.github.integration.GitHubIntegration.get_trees_for_org" )
63+ def test_get_frame_with_module (self , mock_get_trees_for_org : Any ) -> None :
64+ config_data = {
65+ "absPath" : "Billing.kt" ,
66+ "module" : "com.waffleware.billing.Billing$1" ,
67+ "platform" : "java" ,
68+ "stacktraceFilename" : "Billing.kt" ,
69+ }
70+ expected_matches = [
71+ {
72+ "filename" : "Billing.kt" ,
73+ "repo_name" : "getsentry/codemap" ,
74+ "repo_branch" : "master" ,
75+ "stacktrace_root" : "com/waffleware/" ,
76+ "source_path" : "app/src/main/java/com/waffleware/" ,
77+ }
78+ ]
79+ with patch (
80+ "sentry.issues.auto_source_code_config.code_mapping.CodeMappingTreesHelper.get_file_and_repo_matches" ,
81+ return_value = expected_matches ,
82+ ):
83+ response = self .client .get (self .url , data = config_data , format = "json" )
84+ assert mock_get_trees_for_org .call_count == 1
85+ assert response .status_code == 200 , response .content
86+ assert response .data == expected_matches
87+
6288 @patch ("sentry.integrations.github.integration.GitHubIntegration.get_trees_for_org" )
6389 def test_get_start_with_backslash (self , mock_get_trees_for_org : Any ) -> None :
6490 file = "stack/root/file.py"
0 commit comments