@@ -269,9 +269,9 @@ class MockIssue(object):
269269 )
270270
271271 @mock .patch (PATH + "_filter_downstream_issues" )
272- @mock .patch (PATH + "_get_existing_jira_issue_query " )
272+ @mock .patch (PATH + "_get_existing_jira_issue_keys " )
273273 @mock .patch ("jira.client.JIRA" )
274- def test_get_existing_newstyle (self , mock_client , mock_get_query , mock_filter ):
274+ def test_get_existing_newstyle (self , mock_client , mock_get_keys , mock_filter ):
275275 """
276276 This tests 'get_existing_jira_issue' function.
277277 """
@@ -290,7 +290,7 @@ def test_get_existing_newstyle(self, mock_client, mock_get_query, mock_filter):
290290
291291 scenarios = (
292292 {
293- "scenario" : "_get_existing_jira_issue_query returns no keys" ,
293+ "scenario" : "_get_existing_jira_issue_keys returns no keys" ,
294294 "query_return" : (),
295295 "search_issues" : None ,
296296 "filter_results" : None ,
@@ -347,7 +347,7 @@ def test_get_existing_newstyle(self, mock_client, mock_get_query, mock_filter):
347347
348348 for x in scenarios :
349349 d .jira_cache = d .UrlCache () # Clear the cache
350- mock_get_query .return_value = x ["query_return" ]
350+ mock_get_keys .return_value = x ["query_return" ]
351351 mock_client .search_issues .return_value = x ["search_issues" ]
352352 mock_filter .return_value = x ["filter_results" ]
353353 mock_client .issue .side_effect = x ["issue_side_effect" ]
@@ -361,7 +361,7 @@ def test_get_existing_newstyle(self, mock_client, mock_get_query, mock_filter):
361361 self .assertEqual (d .jira_cache [self .mock_issue .url ], x ["expected" ].key )
362362
363363 @mock .patch (PATH + "execute_snowflake_query" )
364- def test_get_existing_jira_issue_query (self , mock_snowflake ):
364+ def test_get_existing_jira_issue_keys (self , mock_snowflake ):
365365 scenarios = (
366366 {
367367 "jira_cache" : {self .mock_issue .url : "issue_key" },
@@ -371,7 +371,7 @@ def test_get_existing_jira_issue_query(self, mock_snowflake):
371371 {
372372 "jira_cache" : {},
373373 "snowflake" : (),
374- "expected" : None ,
374+ "expected" : () ,
375375 },
376376 {
377377 "jira_cache" : {},
@@ -392,7 +392,7 @@ def test_get_existing_jira_issue_query(self, mock_snowflake):
392392 for x in scenarios :
393393 d .jira_cache = x ["jira_cache" ]
394394 mock_snowflake .return_value = x ["snowflake" ]
395- result = d ._get_existing_jira_issue_query (self .mock_issue )
395+ result = d ._get_existing_jira_issue_keys (self .mock_issue )
396396 self .assertEqual (result , x ["expected" ])
397397
398398 @mock .patch (PATH + "find_username" )
@@ -1720,6 +1720,15 @@ def test_jira_user_display_label(self):
17201720 d ._jira_user_display_label (types .SimpleNamespace (name = "bob_only" )),
17211721 "bob_only" ,
17221722 )
1723+ self .assertEqual (
1724+ d ._jira_user_display_label (
1725+ types .SimpleNamespace (displayName = "Alice" , name = "bob" )
1726+ ),
1727+ "Alice" ,
1728+ )
1729+ self .assertIsNone (
1730+ d ._jira_user_display_label (types .SimpleNamespace ()),
1731+ )
17231732
17241733 @mock .patch ("jira.client.JIRA" )
17251734 def test_check_comments_for_duplicates (self , mock_client ):
0 commit comments