Commits

Tetsuya Morimoto committed f542878

fixed to set blank string if None for pattern matching

  • Participants
  • Parent commits bd62302

Comments (0)

Files changed (2)

tests/test_utils.py

 from ticketref import utils
 
 @pytest.mark.parametrize(("comment", "except_ids", "expected"), [
+    (None, None, set([])),
+    (u"", None, set([])),
     (u"refs. #1", None, set([1])),
     (u"refs. #1ab", None, set([1])),
     (u"refs. a#1b", None, set([])),

ticketref/utils.py

     set([4])
     """
     ref_ids = set([])
-    match = re.search(_RE_REFS_WITH_IDS, comment)
+    match = re.search(_RE_REFS_WITH_IDS, comment or u"")
     if match:
         ref_text = match.groupdict().get("ref_text")
         ref_ids = get_ref_ids_in_comment(ref_text)